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

README's "A quick example" get error. #9

Closed
inoue0426 opened this issue Mar 28, 2018 · 2 comments
Closed

README's "A quick example" get error. #9

inoue0426 opened this issue Mar 28, 2018 · 2 comments

Comments

@inoue0426
Copy link

inoue0426 commented Mar 28, 2018

"from tensornets import utils
img = utils.load_img('cat.png', target_size=256, crop_size=224)
assert img.shape == (1, 224, 224, 3)"

This script get error.


AttributeError Traceback (most recent call last)
in ()
1 from tensornets import utils
----> 2 img = utils.load_img('cat.png', target_size=256, crop_size=224)
3 assert img.shape == (1, 224, 224, 3)

~/.conda/envs/tensor/lib/python3.6/site-packages/tensornets/utils.py in load_img(path, grayscale, target_size, crop_size, interp)
176 if isinstance(target_size, int):
177 hw_tuple = tuple([x * target_size // min(img.shape[:2])
--> 178 for x in img.shape[1::-1]])
179 else:
180 hw_tuple = (target_size[1], target_size[0])

AttributeError: 'NoneType' object has no attribute 'shape'

@alain2208
Copy link

got the same under windows i copy one of my pic and defined the complete path to find the image. worked well

@taehoonlee
Copy link
Owner

@inoue0426, It doesn't seem to be a TensorNets issue. You can try the sample codes on the directory where the cat.png exists. Or, you can also give the complete path as @alain2208 said.

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

3 participants