Comments (6)
Hey, it's an PIL.UnidentifiedImageError – the image cannot be opened and identified.
- Are you able to open the image
./train/cat\1004525_cba96ba3c3.jpg
on your working station? Is it a real picture/valid file? Edit: The backslash after cat seems a bit weird to me: the images with the cats should be in an own directory calledcat
, I think it needs to be a slash instead of the backslash. - How have you acquired the image files? Have you used the
download.py
file or the gdrive link?
from beginners-pytorch-deep-learning.
Hey, it's an PIL.UnidentifiedImageError – the image cannot be opened and identified.
- Are you able to open the image
./train/cat\1004525_cba96ba3c3.jpg
on your working station? Is it a real picture/valid file? Edit: The backslash after cat seems a bit weird to me: the images with the cats should be in an own directory calledcat
, I think it needs to be a slash instead of the backslash.- How have you acquired the image files? Have you used the
download.py
file or the gdrive link?
_
thanks for your help!
I download this image package through G Drive, after your reminder, i check the package on my PC and found '1004525_cba96ba3c3.jpg' has broken, does it means i must use check_image()?
from beginners-pytorch-deep-learning.
Yes, please adjust your code for the three respective lines and add , is_valid_file=check_image. The check_image()
function is included to avoid these kind of error messages and the broken images not being considered.
For example for the training data use the ImageFolder class as follows (see https://github.com/falloutdurham/beginners-pytorch-deep-learning/blob/master/chapter2/Chapter%202.ipynb):
train_data = torchvision.datasets.ImageFolder(root=train_data_path,
transform=img_transforms,
is_valid_file=check_image)
The same for val_data
and test_data
.
Is there any reason you deleted it in the code you forked from the gihub repo?
from beginners-pytorch-deep-learning.
If you got an FileNotFoundError
with the check_image()
function please check out #71.
from beginners-pytorch-deep-learning.
Yes, please adjust your code for the three respective lines and add , is_valid_file=check_image. The
check_image()
function is included to avoid these kind of error messages and the broken images not being considered.For example for the training data use the ImageFolder class as follows (see https://github.com/falloutdurham/beginners-pytorch-deep-learning/blob/master/chapter2/Chapter%202.ipynb):
train_data = torchvision.datasets.ImageFolder(root=train_data_path, transform=img_transforms, is_valid_file=check_image)
The same for
val_data
andtest_data
.Is there any reason you deleted it in the code you forked from the gihub repo?
Thanks for your patient!
The reason I delete 'img_check()' is I noticed the bug in torchvision you mentioned in another issue, it seems that the function is important for both download by Url and GDrive. Or we can update a new image package to GDrive.
from beginners-pytorch-deep-learning.
Yes, unfortunately also some GDrive images seem to be affected, but there is no issue at all as long it's possible to include the check_image()
function.
I think it's best to downgrade torchvision
to 0.10.1
as mentionend in #71 - or you can upgrade to 0.12.0
(released 2 days ago; the bug mentioned in #71 has been fixed in the release - but be aware that the new release has not been tested for this book repo yet).
from beginners-pytorch-deep-learning.
Related Issues (20)
- Ch. 8 Flask service: server.py not executable
- Ch 5 Error: OSError: [E050] Can't find model 'en'. HOT 1
- Chapter 4 - Replacing the Classifier HOT 2
- Dataset for chapter 2 HOT 2
- Many cat and fish pictures seem to be missing HOT 2
- How do you evaluate Chapter 3 Model? HOT 3
- Chapter 6: A Journey Into Sound HOT 2
- How to use the function named classify_tweet in chapter5? HOT 4
- the csv link seems not work and I alter another images folder
- problem with googletrans and 'the cat sat on the mat' HOT 2
- Chapter 5: Problem with latest version of Juypter Notebook HOT 3
- Chapter 4: cannot assign 'torch.nn.modules.container.Sequential' as child module HOT 6
- chapter 2 - training loss differet in github and in the book HOT 1
- chapter 5 becoming obsolete :-( HOT 4
- Chapter 2: Imagefolder passes only filename without path to `is_valid_file` HOT 2
- chapter 2, page 21: 'data' is not defined in data.DataLoader() HOT 2
- Chapter 6: The ESC-50 folder name are different between book and repo code HOT 1
- Chapter 3 - Making Predictions Method from Chapter 2 does not work HOT 4
- Chapter 2: Error with the check_image function HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from beginners-pytorch-deep-learning.