Untar didn’t work becase something in the source code that I read stopped it from unzipping a tar.gz file.
I downloaded it using wget (and the ! method in Jupyter notebook) and then tried to untar it using the tarfile module in python but that didn’t work either, and I got this error TypeError: expected str, bytes or os.PathLike object, not TarFile
@vishak@AjayStark
Can you please share the line of code you wrote to untar the file?
In general, I think the best way to untar a file is to use the command line(or the ! method from jupyter notebook) itself.
Go to the directory where the tar file is present,(in your case, if you downloaded the file with the wget method from the Jupiter notebook, the file should be present in the same directory).
then type
!tar xvzf <filename.tar.gz>
that should work fine.
(as a suggestion, first shift the file into the Config.data_path directory (most probably (~/.fastai/data), and shift it into a directory, and then untar from there, so that if the file contains multiple files/folders, you need not shift each one of them to a convenient location
You can do that from the command line itself)
Hi @PalaashAgrawal Thank you for the reply.
In my case, the issue was that the untar_data() by default adds .tar.gz extension to the url so removing the extension worked well.