I was trying to clone and install the Google Unrestricted adversarial examples repository following the instructions provided here. But I am unable to import the any of the modules. First I cloned the repository and changed to that directory.
!git clone https://github.com/google/unrestricted-adversarial-examples.git
cd unrestricted-adversarial-examples
Then I used the pip install command.
!pip -e install bird-or-bicycle
The installation completed without any error. However, when I try to import I get the 'module not found error'. Could anyone tell me what I am doing wrong? I tried the same commands on my PC and it works.
import bird_or_bicycle
ModuleNotFoundError: No module named 'bird_or_bicycle'
I just got the solution after posting an issue to the repository. The solution was simple, all I needed to do was restart the Colab kernel (Restart Runtime option in the Runtime tab) after !pip -e install bird-or-bicycle
Apparently that is required to pick up the newly installed package.
If you look at the bird-or-bicycle docs, you see that there is a data download step required after you pip install.
If you follow the instructions there and run the following in a notebook cell, then the import will work:
!git clone https://github.com/google/unrestricted-adversarial-examples
!pip install -e unrestricted-adversarial-examples/bird-or-bicycle
!bird-or-bicycle-download
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With