FourierHeatmap icon indicating copy to clipboard operation
FourierHeatmap copied to clipboard

Execution issue in v0.1.0

Open karthikramesh55 opened this issue 3 years ago • 1 comments

Hello,

First off, thank you for the Fourier analysis implementation. Just have 2 questions:

  1. For the below command, what exactly is going on with the [WEIGHT PATH] argument? Should the weight path be manually typed there? python eval.py -a resnet56 -w [WEIGHT_PATH] -d cifar10 --h_map_size 31 --w_map_size 31 -k 1 -l [LOG_DIR] --eps 32

  2. Also, when I try to load a pretrained model "resnet34" using the below command:

python eval.py -a resnet34 -w [WEIGHT_PATH] -d cifar10 --h_map_size 31 --w_map_size 31 -k 1 -l [LOG_DIR] --eps 32

I get the following error:

Traceback (most recent call last): File "eval.py", line 76, in main() File "/home/karthikramesh55/anaconda3/lib/python3.7/site-packages/click/core.py", line 764, in call return self.main(*args, **kwargs) File "/home/karthikramesh55/anaconda3/lib/python3.7/site-packages/click/core.py", line 717, in main rv = self.invoke(ctx) File "/home/karthikramesh55/anaconda3/lib/python3.7/site-packages/click/core.py", line 956, in invoke return ctx.invoke(self.callback, **ctx.params) File "/home/karthikramesh55/anaconda3/lib/python3.7/site-packages/click/core.py", line 555, in invoke return callback(*args, **kwargs) File "eval.py", line 49, in main eval(**kwargs) File "eval.py", line 67, in eval FLAGS.arch].cuda() ###pretrained=False (default) File "/home/karthikramesh55/FourierHeatmapV1/apps/../misc/model.py", line 34, in getitem return self._get_classifier(name, num_classes=self.num_classes, pretrained=self.pretrained, inplace=self.inplace, use_bn=self.use_bn) File "/home/karthikramesh55/FourierHeatmapV1/apps/../misc/model.py", line 50, in _get_classifier self._replace_final_fc(name, model, num_classes) TypeError: _replace_final_fc() takes 3 positional arguments but 4 were given

Awaiting your valuable response

karthikramesh55 avatar May 17 '21 06:05 karthikramesh55

Disclaimer: not an author of this repo, just experimenting with it.

1: Yes. Here you'll find the weights for downloading: https://github.com/akamaster/pytorch_resnet_cifar10. They should probably be on the readme IMO. I could not find out how to use relative paths, but absolute paths worked (e.g. ~/FourierHeatMap/fhmap/resnet50.pt)

2: On the current version resnet34 is not available as default and you would need to add it yourself on schema/arch.py, don't know about the previous versions.

yurigalindo avatar Sep 28 '21 21:09 yurigalindo