kumar-shridhar / PyTorch-BayesianCNN

Bayesian Convolutional Neural Network with Variational Inference based on Bayes by Backprop in PyTorch.
MIT License
1.42k stars 323 forks source link

an error about GaussianVariationalInference #36

Closed ShellingFord221 closed 4 years ago

ShellingFord221 commented 4 years ago

Hi, I want to run Image Recognition part of your code, but in PyTorch-BayesianCNN/Image Recognition/main_Bayes.py , line 27 and line 139, there is an error:

from utils.BBBlayers import GaussianVariationalInference vi = GaussianVariationalInference(torch.nn.CrossEntropyLoss())

This is because BBBlayers.py file doesn't contain GaussianVariationalInference, but in your old code BBBlayers_.py, line 308, there is a class GaussianVariationalInference(nn.Module). It seems that your new code needs a little fix...

kumar-shridhar commented 4 years ago

Hi @ShellingFord221 ,

For the new code, the jupyter notebook is the only one that is updated. I will soon update the whole repo. But at the moment, please use the jupyter notebook code.

Thanks!