gyhui14 / spottune

SpotTune: Transfer Learning through Adaptive Fine-tuning
88 stars 23 forks source link

Validation accuracy on aircraft dataset and Model for Stanford Cars #5

Open YuWang24 opened 4 years ago

YuWang24 commented 4 years ago

Hi Dr Guo

Sorry to bother you again. After the last chat with you, I split the validation set from training set. So, I train only on the training set and evaluate on the validation set. However, after several times training, I can only get an validation accuracy around 52% on aircraft dataset. I am using the default settings and hyperparameters. And the weight decay = 0.0005 is default as well. I only load the aircraft dataset and only train and test on this dataset. Could you please give me any explanation or guidance why the validation accuracy is much lower than the figure shown in the paper? Should I change any of the hyperparameters? Or I made mistake on anywhere? The settings and hyperparameters are shown below. Thanks.

parser.add_argument('--nb_epochs', default=110, type=int, help='nb epochs') parser.add_argument('--lr', default=0.1, type=float, help='initial learning rate of net') parser.add_argument('--lr_agent', default=0.01, type=float, help='initial learning rate of agent') parser.add_argument('--datadir', default='./data/decathlon-1.0/', help='folder containing data folder') parser.add_argument('--imdbdir', default='./data/decathlon-1.0/annotations/', help='annotation folder') parser.add_argument('--ckpdir', default='./cv/', help='folder saving checkpoint') parser.add_argument('--seed', default=0, type=int, help='seed') parser.add_argument('--step1', default=40, type=int, help='nb epochs before first lr decrease') parser.add_argument('--step2', default=60, type=int, help='nb epochs before second lr decrease') parser.add_argument('--step3', default=80, type=int, help='nb epochs before third lr decrease')

Also, I am going to use Stanford Cars as my dataset. I noticed that in the paper it is stated that the Stanfords Car dataset is trained on the standard Pytorch ResNet50 model that is pretrained on ImageNet. However, the code for this model and training is not provided in this GitHub page. So, I have no idea how you combine the policy network with the default Pytorch ResNet50 Model. I tried to use the ResNet26 as the model to train on Stanford Cars, but the validation accuracy in the first epochs are not quite good (less than 1% after 5 epochs). Is it possible to provide this part of code of how you train on the Stanford Cars dataset by using ResNet50? Thank you very much!

zhengyulau commented 4 years ago

hi,sorry to bother you.i got some trouble when i tried to run 'summit_val.py'.thr erorr are shown below.

Traceback (most recent call last): File "submit_val.py", line 216, in net, agent = get_net_and_agent('resnet26', num_class, dataset) File "/home/liu/spottune/submit/utils.py", line 142, in get_net_and_agent rnet, agent = load_weights_to_flatresnet(source, rnet, agent, dataset) File "/home/liu/spottune/submit/utils.py", line 124, in load_weights_to_flatresnet agent.linear.weight.data = torch.nn.Parameter(agent_old.module.linear.weight.data.clone()) File "/home/liu/anaconda3/envs/spottune/lib/python2.7/site-packages/torch/nn/modules/module.py", line 518, in getattr type(self).name, name)) AttributeError: 'ResNet' object has no attribute 'module'

looking for your replyment.thanks.

wf-hahaha commented 4 years ago

@gyhui14 hi,sorry to bother you.i got some trouble when i tried to run 'summit_val.py'.thr erorr are shown below.

Traceback (most recent call last): File "submit_val.py", line 216, in net, agent = get_net_and_agent('resnet26', num_class, dataset) File "/home/liu/spottune/submit/utils.py", line 142, in get_net_and_agent rnet, agent = load_weights_to_flatresnet(source, rnet, agent, dataset) File "/home/liu/spottune/submit/utils.py", line 124, in load_weights_to_flatresnet agent.linear.weight.data = torch.nn.Parameter(agent_old.module.linear.weight.data.clone()) File "/home/liu/anaconda3/envs/spottune/lib/python2.7/site-packages/torch/nn/modules/module.py", line 518, in getattr type(self).name, name)) AttributeError: 'ResNet' object has no attribute 'module'

looking for your replyment.thanks.

fyjqiuqiu123 commented 3 years ago

Hi Dr Guo I'm sorry to bother you. I'm having some problems while trying to understand your code.

  1. Why did you choose such a lightweight network as a policy network, and how does it work?
  2. During training, are agent_NET and NET being trained simultaneously? Looking for your replyment. Thanks.