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

Some typo and error "ModuleNotFoundError: No module named 'ssl_priors'" #1

Closed
SungJun98 opened this issue Sep 7, 2022 · 2 comments
Closed

Comments

@SungJun98
Copy link

Hi, I got impressed with ur paper and am trying to replicate the results from your paper, but I've been stuck with some problems.

To check it's working, I followed ur guideline and did like this:

python3 prior_run_jobs.py --job=supervised_bayesian_learning --prior_type=shifted_gaussian --prior_path=resnet50_torchvision.pt --train_dataset=cifar10 --val_dataset=cifar10 --prior_scale=1e6 --number_of_samples_prior=5 --encoder=resnet50 --ignore_wandb

(I tried to use your pre-trained priors)

At first, it didn't work and i found some typo with ur files e.g. 'baysian' for 'bayesian', 'lern' for 'learn'

After fixing this typos, I got error like this:

Traceback (most recent call last):
File "prior_run_jobs.py", line 20, in
bayesian_learner.learn()
File "/home/BayesianTransferLearning-main/priorBox/Bayesian_learning/Bayesian_supervised.py", line 32, in learn
training_function(config, train_loader, test_loader)
File "/home/BayesianTransferLearning-main/priorBox/Bayesian_learning/train_supervised.py", line 69, in training_function
train_main(config, train_loader=train_loader, test_loader=test_loader, test_loaders=test_loaders)
File "/home/BayesianTransferLearning-main/priorBox/Bayesian_learning/train_supervised.py", line 27, in train_main
prior_params = load_prior(config['prior_path'], config,
File "/home/BayesianTransferLearning-main/priorBox/sghmc/utils.py", line 31, in load_prior
state = torch.load(path)
File "/home/.local/lib/python3.8/site-packages/torch/serialization.py", line 594, in load
return _load(opened_zipfile, map_location, pickle_module, **pickle_load_args)
File "/home/.local/lib/python3.8/site-packages/torch/serialization.py", line 853, in _load
result = unpickler.load()
ModuleNotFoundError: No module named 'ssl_priors'

I found some docs about the problem what i faced but it also didn't work.

pytorch/pytorch#18325

pytorch/pytorch#3678

Can you give me any suggestion to solve this problem?

Thanks for ur kind answer :)

@hsouri
Copy link
Owner

hsouri commented Sep 23, 2022

Thank you for your interest in our work. I fixed the bugs. you may now pull the code and run it. Please download the weights from here. These files contain the model weight, mean, variance, and cov_factor fields. The prior_path must fit to the following format: prior_path_model.pt, prior_path_mean.pt, prior_path_variance.pt, prior_path_covmat.pt. Therefore, you should pass --prior_path download_dir/pretrained_priors/resnet50_torchvision/resnet50_torchvision. Please replace the "download_dir" to the directory where you downloaded pretrained_priors.

Please let me know if you have any questions.

@SungJun98
Copy link
Author

Thank you for your kind description.
I retry with your new code and it works well now :)
I appreciate with your help again and congratulate you on the result of NeurIPS 2022!

@hsouri hsouri pinned this issue Sep 26, 2022
@hsouri hsouri closed this as completed Sep 26, 2022
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