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.
Solution
Original Code
PRNet_PyTorch/tools/WLP300dataset.py
Line 53 in 2d30e24
Fixed version
or simply just remove
if img_id:why
The
TypeError: cannot unpack non-iterable NoneType objectoccurs when the functionget_img_pathinPRNetDatasettries to loadimg_id == 0.When the
generate_posmap_300WLP.pyis 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:
Therefore, the function does not return a value, causing the data loader to bug out.