openphilanthropy / unrestricted-adversarial-examples

Contest Proposal and infrastructure for the Unrestricted Adversarial Examples Challenge
Apache License 2.0
327 stars 62 forks source link

Error when running the example #53

Closed kyleliang919 closed 5 years ago

kyleliang919 commented 5 years ago

AttributeError: 'ImageFolderWithFilenames' object has no attribute 'samples'. I am also looking into the issue, but I am kind of clueless. Does anybody else have the same problem?

Below is the full trace.

/anaconda/envs/py35/lib/python3.5/site-packages/h5py/init.py:36:

FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type. from ._conv import register_converters as _register_converters 2018-10-08 19:25:41.909854: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA 2018-10-08 19:25:46.158794: E tensorflow/stream_executor/cuda/cuda_driver.cc:397] failed call to cuInit: CUDA_ERROR_NO_DEVICE 2018-10-08 19:25:46.158860: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:158] retrieving CUDA diagnostic information for host: kk80 2018-10-08 19:25:46.158882: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:165] hostname: kk80 2018-10-08 19:25:46.158944: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:189] libcuda reported version is: 390.30.0 2018-10-08 19:25:46.159004: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:193] kernel reported version is: 390.30.0 2018-10-08 19:25:46.159025: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:300] kernel version seems to match DSO: 390.30.0 Verification of dataset successful. Dataset is correctly prepared. Verification of dataset successful. Dataset is correctly prepared. Traceback (most recent call last): File "main.py", line 44, in model_name='undefended_keras_resnet') File "/home/pdimage/notebooks/Semantic_AdvGAN/imagenet/unrestricted-adversarial-examples/unrestricted-advex/unrestricted_advex/eval_kit.py", line 290, in evaluate_bird_or_bicycle_model label_to_examples=_get_bird_or_bicycle_label_to_examples(), File "/home/pdimage/notebooks/Semantic_AdvGAN/imagenet/unrestricted-adversarial-examples/unrestricted-advex/unrestricted_advex/eval_kit.py", line 243, in _get_bird_or_bicycle_label_to_examples for x_np, ynp, in dataset_iter: File "/home/pdimage/notebooks/Semantic_AdvGAN/imagenet/unrestricted-adversarial-examples/bird-or-bicycle/bird_or_bicycle/iterator.py", line 53, in dataset_iter = ((x_batch.numpy(), y_batch.numpy(), image_ids) File "/anaconda/envs/py35/lib/python3.5/site-packages/torch/utils/data/dataloader.py", line 259, in next batch = self.collate_fn([self.dataset[i] for i in indices]) File "/anaconda/envs/py35/lib/python3.5/site-packages/torch/utils/data/dataloader.py", line 259, in batch = self.collate_fn([self.dataset[i] for i in indices]) File "/home/pdimage/notebooks/Semantic_AdvGAN/imagenet/unrestricted-adversarial-examples/bird-or-bicycle/bird_orbicycle/iterator.py", line 18, in getitem path, = self.samples[index] AttributeError: 'ImageFolderWithFilenames' object has no attribute 'samples

nottombrown commented 5 years ago

What version of torch and torchvision are you using?

kyleliang919 commented 5 years ago

I am using keras, not pytorch, tensorflow 1.9.0

nottombrown commented 5 years ago

We install torchvision as a dependency. If you do pip freeze | grep torch what is your output? On Mon, Oct 8, 2018 at 6:36 PM kyleliang919 notifications@github.com wrote:

I am using keras, not pytorch, tensorflow 1.9.0

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/google/unrestricted-adversarial-examples/issues/53#issuecomment-428030897, or mute the thread https://github.com/notifications/unsubscribe-auth/AASt371DGsdNFlZeVKo53m4ktQ2uNBK-ks5ui_24gaJpZM4XNian .

nottombrown commented 5 years ago

Closing this due to inactivity. Please reopen if this issue continues.

YinYangOfDao commented 5 years ago

Closing this due to inactivity. Please reopen if this issue continues.

I have the same issue. I used pytorch 0.4.1 py36ha74772b_0
torchvision 0.2.0 py36h17b6947_1 pytorch

YinYangOfDao commented 5 years ago

Closing this due to inactivity. Please reopen if this issue continues.

I think line 18 in bird_orbicycle/iterator.py should be `path, = self.imgs[index]`