Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Step: g) How to make inference on images based on a trained model not working #30

Open
tejgvsl opened this issue Dec 5, 2018 · 4 comments
Assignees

Comments

@tejgvsl
Copy link

tejgvsl commented Dec 5, 2018

Hello Mr.Hu,
Step-g) How to make inference on images based on a trained model
Test on other images: (e.g. sample_inputs/a.png)
python2 fc4.py test pretrained/colorchecker_fold1and2.ckpt -1 sample_inputs/a.png

is not working with the above command. Observing the below error:

Loading image pack None
Traceback (most recent call last):
File "fc4.py", line 227, in
globals()mode
File "fc4.py", line 34, in test
data = load_data(image_pack_name.split(','))
File "/data/color_constancy/fc4/data_provider.py", line 23, in load_data
with open(fn) as f:
TypeError: coercing to Unicode: need string or buffer, NoneType found

Please help to resolve the issue. Tried to execute with sample_inputs/a.png

Thank you..

@yuanming-hu yuanming-hu self-assigned this Dec 6, 2018
@yuanming-hu
Copy link
Owner

Thanks for letting me know. I'm travelling and will take a look once I get back to MIT.

@chiuhc
Copy link

chiuhc commented Dec 7, 2018

It works fine in my environment.
You can try to use pdb.set_trace() to print out input filename and see if there is any weird thing occur under your environment, so that test_external() is not able to cv2.imread the image file correctly.

@tejgvsl
Copy link
Author

tejgvsl commented Dec 11, 2018

Hi...
Finally able to run inference on own image using 'python3', with below change to resolve pickle load compatibility issue:
replace Line: 22 in squeeze_net.py -----> self.model = pkl.load(open(MODEL_PATH, 'r')) with

with open(MODEL_PATH, "rb") as f:
self.model = pkl.load(f, encoding="latin")

However the issue still remains with python2.
Please correct if i am missing something.

Thank you.
Tej.

@cploveflower
Copy link

Thank you for the providing,I have solved my question.

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

No branches or pull requests

4 participants