Closed ShugeLei closed 4 years ago
I just double-checked my local project, all updates for Task 2 have been committed and pushed to the GitHub. And the scripts work correctly here.
From the description, I cannot get enough info to replicate your problem.
My suggestions would be:
craft_adversarial_examples.py
by clicking the run button (the green triangle if you are using PyCharm).For Jupyter notebook, before you enter the notebook. you need to activate the proper environment first.
One question for you, why you did not encounter this issue when working on Task 1?
I think this issue may be solved by setting your root directory to the '/src' directory. In Pycharm, try right-clicking on the /src folder -> mark directory as -> mark sources root. I'm not sure if those buttons are named exactly that, but that is the general process. Let me know if this helps @ShugeLei or if you have already done this.
Thanks @Dojone98!
@MENG2010 @Dojones98 Thanks for your prompt response! I appreciate it so much. Let me work on it based on your suggestions and see what's going on.
If you prefer to run the script from the terminal using a command line, appending the parent directory to the path.
I just added the parent directory to the path, so all the python tutorials should be able to run correctly via terminal. Please check the latest commitments.
problem solved.
Hello everyone,
I have followed all Ying's instructions, yet I still have such problems: ### ModuleNotFoundError: No module named 'utils.model'. It seems like I always have such problems when ### importing the module under the package.
I tried the method as below, add an init.py under the package utils, yet it still did not work. Do you know what’s wrong with my work? ( We have discussed in our team, we can’t solve the problem yet. Two of our members met such problems.)
Thanks, Shuge
Python 3.7.6 (default, Jan 8 2020, 13:42:34) Type "copyright", "credits" or "license" for more information.
IPython 7.18.1 -- An enhanced Interactive Python.
runfile('/Users/shugelei/Desktop/2020Fall/CSCE585/project-athena-master/src/tutorials/craft_adversarial_examples.py', wdir='/Users/shugelei/Desktop/2020Fall/CSCE585/project-athena-master/src/tutorials') Traceback (most recent call last):
File "/Users/shugelei/Desktop/2020Fall/CSCE585/project-athena-master/src/tutorials/craft_adversarial_examples.py", line 12, in
from utils.model import load_lenet
### ModuleNotFoundError: No module named 'utils.model'