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

Error in running label-maker for skynet-train #122

Closed
emackres opened this issue Nov 18, 2018 · 5 comments
Closed

Error in running label-maker for skynet-train #122

emackres opened this issue Nov 18, 2018 · 5 comments

Comments

@emackres
Copy link

Great to see this new data prep workflow for Skynet.
https://github.com/developmentseed/label-maker/blob/master/examples/skynet-train-data-prep.md

After using label-maker, I got the utility script to run but got an error:

Traceback (most recent call last):
  File "skynet.py", line 24, in <module>
    img = Image.fromarray(label.astype(np.uint8))
  File "/Users/eric/anaconda3/lib/python3.6/site-packages/PIL/Image.py", line 2431, in fromarray
    size = shape[1], shape[0]
IndexError: tuple index out of range

It would be great to know if this is a problem with my setup, or if others are experiencing it and to get it addressed.

Also, I think there is a typo and the reference to the utility script python utils/segnet.py should actually be python utils/skynet.py

@drewbo
Copy link
Contributor

drewbo commented Nov 19, 2018

@emackres thanks for trying it out! Can you post your config.json and I'll try to recreate?

@yulifengwx
Copy link

yulifengwx commented Jan 7, 2019

@drewbo @emackres I also got the same error. my config.json like this:
{ "country": "togo", "bounding_box": [1.09725, 6.05520, 1.34582, 6.30915], "zoom": 12, "classes": [ { "name": "Buildings", "filter": ["has", "building"] }, { "name": "Road", "filter": ["has", "highway"] } ], "imagery": "http://a.tiles.mapbox.com/v4/mapbox.satellite/{z}/{x}/{y}.jpg?access_token=access-tocken", "background_ratio": 1, "ml_type": "classification" }
the error like this:

Traceback (most recent call last):
File "E:/work/AI/label-maker/examples/utils/skynet.py", line 25, in
img = Image.fromarray(label.astype(np.uint8))
File "D:\ProgramData\Anaconda3\envs\skynet\lib\site-packages\PIL\Image.py", line 2431, in fromarray
size = shape[1], shape[0]
IndexError: tuple index out of range

the cause is that the length of label.shape is 1 , in PIL method Image.fromarray , "size = shape[1], shape[0]" shape[1] index 1 out of range

@drewbo
Copy link
Contributor

drewbo commented Jan 7, 2019

@yulifengwx this script is only intended for segmentations labels. Can you try again with the ml_type changed to segmentation?

@yulifengwx
Copy link

@yulifengwx this script is only intended for segmentations labels. Can you try again with the ml_type changed to segmentation?
@drewbo Thanks for reply , set ml_type to segmentation solve the error. But this is another error when runing with lastest verison numpy:
skynet.py in line 34, in keys.remove(key) ==> 'KeysView' object has no attribute 'remove'.
with numpy v1.13.3 the error did not occur.

@drewbo
Copy link
Contributor

drewbo commented Jan 7, 2019

we're pinned against v1.13.3 for now but let me know if you can make this work for more recent versions

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