tiler icon indicating copy to clipboard operation
tiler copied to clipboard

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

Open lyhuangj opened this issue 4 years ago β€’ 10 comments

Traceback (most recent call last): File "tiler.py", line 223, in main() File "tiler.py", line 206, in main tiles_paths = conf.TILES_FOLDER.split(' ') AttributeError: 'NoneType' object has no attribute 'split'

lyhuangj avatar Sep 14 '19 10:09 lyhuangj

Did you pass arguments to the script?

You have two ways you can use: python tiler.py path/to/image path/to/tiles_folder/, or python tiler.py and setting the image and the tiles paths in the conf.py file.

nuno-faria avatar Sep 14 '19 10:09 nuno-faria

IMAGE_TO_TILE = 'images/'

folder with tiles (ignored if passed as the 2nd arg)

TILES_FOLDER = 'tiles/minecraft' Can i set it like this?

hgq520 avatar Mar 30 '20 14:03 hgq520

IMAGE_TO_TILE must be an image (ex: IMAGE_TO_TILE = 'some_image.png') and not a folder. The TILES_FOLDER looks correct.

nuno-faria avatar Mar 30 '20 14:03 nuno-faria

D:\tiler>python tiler.py D:\tiler\images\cake_at_simple.png D:\tiler Loading tiles 0%| | 0/11 [00:00<?, ?it/s] Traceback (most recent call last): File "tiler.py", line 223, in main() File "tiler.py", line 216, in main tiles = load_tiles(tiles_paths) File "tiler.py", line 85, in load_tiles tile = read_image(os.path.join(path, tile_name)) File "tiler.py", line 34, in read_image if img.shape[2] == 3: AttributeError: 'NoneType' object has no attribute 'shape'

arbaleast avatar Aug 11 '20 10:08 arbaleast

where is the problem? guys

arbaleast avatar Aug 11 '20 10:08 arbaleast

The second argument must be a folder with just the tiles. D:\tiler must have other types of files. Try D:\tiler\tiles\times\gen_times\.

nuno-faria avatar Aug 11 '20 11:08 nuno-faria

thank you very much

arbaleast avatar Aug 11 '20 23:08 arbaleast

Also, check if there are hidden files in the "D:\tiler" folder which are not image types.

anjandash avatar Nov 22 '20 12:11 anjandash

I looked at what the people wrote above, and I found that I wrote my address right, no other files, and ran at first, but then still reported the same error.where is the problem?

(base) D:\idea\tiler>python tiler.py ./photo/gen_Lemo ./tiles/lego/gen_lego_h/
Loading tiles
100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 125/125 [00:05<00:00, 24.91it/s]
Getting and processing boxes
Traceback (most recent call last):
  File "D:\idea\tiler\tiler.py", line 223, in <module>
    main()
  File "D:\idea\tiler\tiler.py", line 217, in main
    boxes, original_res = get_processed_image_boxes(image_path, tiles)
  File "D:\idea\tiler\tiler.py", line 151, in get_processed_image_boxes
    img = read_image(image_path)
  File "D:\idea\tiler\tiler.py", line 34, in read_image
    if img.shape[2] == 3:
AttributeError: 'NoneType' object has no attribute 'shape'

chai-debug avatar Dec 15 '21 15:12 chai-debug

I know where I m wrong,I used my gen_file.Thanks to open source.

chai-debug avatar Dec 15 '21 15:12 chai-debug