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

running error: ModuleNotFoundError: No module named 'pretrainedmodels' #16

Open
LinyeLyuNeo opened this issue Feb 20, 2024 · 2 comments

Comments

@LinyeLyuNeo
Copy link

Hi Chen, great work for adversarial attack using diffusion models, I am trying to run your code but getting the following errors:

python main.py --model_name "inception" --save_dir output --images_root demo/images --label_path demo/labels.txt
Traceback (most recent call last):
File "main.py", line 4, in
import diff_latent_attack
File "/home/Neo2/projects/DiffAttack/diff_latent_attack.py", line 8, in
import other_attacks
File "/home/Neo2/projects/DiffAttack/other_attacks.py", line 16, in
from Finegrained_model import model as otherModel
File "/home/Neo2/projects/DiffAttack/Finegrained_model/model.py", line 3, in
from . import LoadModel
File "/home/Neo2/projects/DiffAttack/Finegrained_model/LoadModel.py", line 4, in
import pretrainedmodels
ModuleNotFoundError: No module named 'pretrainedmodels'

I check the code file in LoadModel.py and find the error location:
from torch import nn
import torch
from torchvision import models
import pretrainedmodels
from .config import pretrained_model

can you give me a hint on how to resolve this error so that I can run the attack on the demo image examples? Thanks!

@WindVChen
Copy link
Owner

Hi @LinyeLyuNeo ,

You can run pip install pretrainedmodels to solve it.

@LinyeLyuNeo
Copy link
Author

Thanks, it fixed this issue, you can close this now!

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

2 participants