[Solved] AttributeError: 'NoneType' object has no attribute 'astype'
cailu opened this issue · 3 comments
cailu commented
Hello
I am following the usage instructions, but get some trouble.
Firstly, I download the image "https://www.flaticon.com/free-icon/cake_1102780", then use the script:
$ python tiler.py ~/Downloads/1102780.svg ~/Downloads
Loading tiles
0%| | 0/7 [00:00<?, ?it/s]
Traceback (most recent call last):
File "tiler.py", line 221, in <module>
main()
File "tiler.py", line 214, in main
tiles = load_tiles(tiles_paths)
File "tiler.py", line 83, in load_tiles
tile = read_image(os.path.join(path, tile_name))
File "tiler.py", line 34, in read_image
img = color_quantization(img.astype('float'), COLOR_DEPTH)
And my env:
$ pip freeze
numpy==1.17.2
opencv-python==4.1.1.26
tqdm==4.35.0
Thanks @nuno-faria,I got it
Here is the solution
python tiler.py ~/Downloads/tmp/cake.png tiles/circles/gen_circle_100/
I though the first parameter is my input image, and second parameter as output directory. But it is not, the second parameter is also input, as basic element.
nuno-faria commented
Does the '~/Downloads' folder only contain images? The folder with the tiles must only contain images. Try with the tiles/circles/gen_circle_100/ to see if it works.
patschreiber commented
I would consider adding that stipulation to the README.md. Seems like an elusive "gotcha."
AlenxHai commented
I also encountered this problem, I don't know how to solve it.