Skip to content

[FIXED] TypeError: cannot unpack non-iterable NoneType object #20

@sngyo

Description

@sngyo

Solution

Original Code

Fixed version

if img_id is not None:
    ...

or simply just remove if img_id:

why

The TypeError: cannot unpack non-iterable NoneType object occurs when the function get_img_path in PRNetDataset tries to load img_id == 0.

When the generate_posmap_300WLP.py is executed according to README.md, each folder is generated sequentially numbered from folder 0 as described.

However, in python, 0 would be same with False as below:

img_id = 0
if img_id: 
    print("true")
else:
    print("false")

>>> false

Therefore, the function does not return a value, causing the data loader to bug out.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions