shikiw / SI-Adv

[CVPR 2022] Shape-invariant Adversarial Point Clouds
MIT License
41 stars 10 forks source link

Why does replacing the dataset with ShapeNetPart report an error as follows. #2

Open Alicebash opened 2 years ago

Alicebash commented 2 years ago

Why does replacing the dataset in command ‘python main.py --dataset ModelNet40 --data_path /your/path/to/dataset/ --transfer_attack_method ifgm_ours --surrogate_model pointnet_cls --target_model pointnet_cls --step_size 0.007 --max_steps 50 --eps 0.16’ with ShapeNetPart report an error as follows: ‘UnboundLocalError: local variable 'batch_id' referenced before assignment’?Looking forward to your response, thanks!

shikiw commented 2 years ago

Could you please provide the whole log that reports this error?

I guess it is because your data loader is an empty iterator, thus please check whether the ShapeNetPart dataset is successfully downloaded and loaded.

Alicebash commented 2 years ago

Thank you very much for your reply, I tried to download the dataset from somewhere else and solved the problem, but when I run srs defense command ’python main.py --dataset ModelNet40 --data_path /data/YwData/PC_work/data/modelnet40_normal_resampled/ --transfer_attack_method ifgm_ours --surrogate_model pointnet_cls --target_model pointnet_cls --defense_method srs --step_size 0.007 --max_steps 50 --eps 0.16‘ , I get the following error, ’AttributeError: 'NoneType' object has no attribute 'data'‘ but SOR as well as DUP-Net is normal, what is wrong with mine?

lvhuanhuan123 commented 1 year ago

May I ask from which place you downloaded the ShapeNetPart dataset, I also encountered the same problem as you. The direct download with the command wget https://shapenet.cs.stanford.edu/ericyi/shapenetcore_partanno_segmentation_benchmark_v0.zip --no-check-certificate is not correct either. Thanks!

lvhuanhuan123 commented 1 year ago

Using random seed 2022 Start Loading Dataset... Finish Loading Dataset... 0it [00:00, ?it/s] Traceback (most recent call last): File "main.py", line 202, in main() File "main.py", line 141, in main atk_success /= batch_id + 1 UnboundLocalError: local variable 'batch_id' referenced before assignment