Skip to content
This repository has been archived by the owner on Oct 30, 2019. It is now read-only.

Use FloatTensor(3, 256, 256):fill(.5) as image in case of reading error #98

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

zhangtemplar
Copy link

I find in very rare case, I still get nil from f:read('a'), it could be a corruption of the disk file or a corruption of RAM. In this case, instead of throwing error, I may want to continue my training process by using a mean image.

@ghost
Copy link

ghost commented Aug 30, 2016

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at [email protected]. Thanks!

@zhangtemplar zhangtemplar reopened this Aug 30, 2016
@zhangtemplar zhangtemplar changed the title Use FloatTensor(3, 256, 256):fix(.5) as image in case of reading error Use FloatTensor(3, 256, 256):fill(.5) as image in case of reading error Aug 30, 2016
@colesbury
Copy link
Contributor

I'm a little worried that this may hide problems with the dataset or data loading code if it doesn't trigger an error. Did you figure out what was wrong with your images? My guess is that they weren't actually JPG or PNG images even if they had that extension.

@zhangtemplar
Copy link
Author

@colesbury no, i have check the images which trigger the error, which works fine by loading it in torch. Again, I suspect it is likely to be memory error.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants