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

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

Closed
KoderKumar opened this issue Apr 16, 2020 · 10 comments
Closed

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

KoderKumar opened this issue Apr 16, 2020 · 10 comments

Comments

@KoderKumar
Copy link

This is the error
python tiler.py
./images/logo.png ./tiles/minecraft
Loading tiles
99%|████████████████████████████████▊| 150/151 [00:52<00:00, 2.96it/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'
99%|████████████████████████████████▊| 150/151 [00:52<00:00, 2.85it/s]

@nuno-faria
Copy link
Owner

Does the folder ./tiles/minecraft contain only images?

@KoderKumar
Copy link
Author

yes

@nuno-faria
Copy link
Owner

Add this line to the function read_image (line 33): print(path) and check the file where it fails.

@KoderKumar
Copy link
Author

It is giving me this error:
File "C:\Users\VVA\Videos\ForYoutube\Python\MinecraftArt\tiler\tiler.py", line 224, in <module> main() File "C:\Users\VVA\Videos\ForYoutube\Python\MinecraftArt\tiler\tiler.py", line 207, in main tiles_paths = conf.TILES_FOLDER.split(' ') AttributeError: 'NoneType' object has no attribute 'split'

@KoderKumar
Copy link
Author

are you going to help?

@nuno-faria
Copy link
Owner

nuno-faria commented Apr 17, 2020

You didn't pass the tiles folder as argument. You either have to run python tiler.py <image_to_tile> <folder_with_tiles> or set those variables in the conf.py file.

@KoderKumar
Copy link
Author

i passed

@nuno-faria
Copy link
Owner

The program only uses the tiles folder from the conf.pyfile if there isn't enough arguments:

    if len(sys.argv) > 2:
        tiles_paths = sys.argv[2:]
    else:
        tiles_paths = conf.TILES_FOLDER.split(' ')

Show me the exact command you entered.

@KoderKumar
Copy link
Author

I was passing 3 arugments

@KoderKumar
Copy link
Author

and conf.py was corrupted, So i reinstall the package

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

2 participants