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

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

Open
Alicebash opened this issue Jun 27, 2022 · 4 comments

Comments

@Alicebash
Copy link

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
Copy link
Owner

shikiw commented Jun 28, 2022

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
Copy link
Author

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
Copy link

lvhuanhuan123 commented Feb 9, 2023

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
Copy link

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

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

3 participants