NVlabs / imaginaire

NVIDIA's Deep Imagination Team's PyTorch Library
Other
4.01k stars 450 forks source link

UnboundLocalError: local variable 'data' referenced before assignment #44

Closed xiaoyun4 closed 3 years ago

xiaoyun4 commented 3 years ago

Hi, when i run the code 'python train.py --single_gpu --config configs/projects/fs_vid2vid/faceForensics/ampO1.yaml' on the reference data of 'projects/fs_vid2vid/test_data/faceForensics/driving'. And the trained dataset and the val dataset are into LMDB format based on 'python scripts/build_lmdb.py --config configs/projects/fs_vid2vid/faceForensics/ampO1.yaml --data_root /projects/fs_vid2vid/test_data/faceForensics/driving/ --output_root datasets/faceForensics/lmdb/[train|val] --paired --overwrite'. During training, the error is :

Traceback (most recent call last): File "train.py", line 104, in main() File "train.py", line 98, in main trainer.end_of_epoch(data, current_epoch, current_iteration) UnboundLocalError: local variable 'data' referenced before assignment

I found that the reason for this problem is for it, data in enumerate(train_data_loader):(train.py line72) this for loop is not executed. How could I solve this problem?

DaddyJin commented 3 years ago

Hey May I ask how you solved this problem?I also encountered this problem. Thx!

leoShen917 commented 2 years ago

Hey May I ask how you solved this problem?I also encountered this problem. Thx!