KushajveerSingh / resize_network_cv

PyTorch implementation of the paper "Learning to Resize Images for Computer Vision Tasks" on Imagenette and Imagewoof datasets
Apache License 2.0
57 stars 11 forks source link

cannot find /data/imagenette2.ckpt file #6

Open Chenchenwenyu opened 3 years ago

Chenchenwenyu commented 3 years ago

path = os.path.join(path, f"{cfg.data.name}.ckpt") ckpt = torch.load(path)['state_dict']

The .ckpt file is not in the dataset I downloaded. Where should I look for this file?Thanks!

Tanzldev commented 3 years ago

hi! the imagenette2.ckpt is missing. where should I find?

km1562 commented 3 years ago

I have the same problem, but when I read the paper, it seems that it is pre training and then fine-tuning on the resize module, so I changed the Pretrain resne.ckpt of epoch 250 to imagenette2.ckpt, and then fine-tuning on the resize module of epoch 20, but the result is not different from that of Pretrain ResNet. Is there a problem in my understanding

Tanzldev commented 3 years ago

I have the same problem, but when I read the paper, it seems that it is pre training and then fine-tuning on the resize module, so I changed the Pretrain resne.ckpt of epoch 250 to imagenette2.ckpt, and then fine-tuning on the resize module of epoch 20, but the result is not different from that of Pretrain ResNet. Is there a problem in my understanding

I want to try it. Is this resNet.ckpt file achieved by using the Tensorflow framework to train own dataset? But the code of this warehouse is based on the pytroch framework.

km1562 commented 3 years ago

I have the same problem, but when I read the paper, it seems that it is pre training and then fine-tuning on the resize module, so I changed the Pretrain resne.ckpt of epoch 250 to imagenette2.ckpt, and then fine-tuning on the resize module of epoch 20, but the result is not different from that of Pretrain ResNet. Is there a problem in my understanding

I want to try it. Is this resNet.ckpt file achieved by using the Tensorflow framework to train own dataset? But the code of this warehouse is based on the pytroch framework.

No, you can see the config, and the trainer.py, from trainer.py you can see that, the model will save the ckpt to the output file under the root file.

""" cfg = cfg.trainer callback = ModelCheckpoint(filename="{epoch}——{val_acc}", #checkpoint 的存储 monitor='val_acc', save_last=True, mode='max') """

In my experient, the output file will save some file according to the time, run the first config, "mv ../config_files/imagenette_resnet50.yaml config.yaml python trainer.py"

according to the cfg.trainer.check_val_every_n_epoch, it will save the result and .ckpt, not all the file will save, I see that it will save the beset result xx.ckpt, check all the file under the output dir, you will see it

and after finetune on the resize module, please tell me the result have any impovement? thank you very much!

Chenchenwenyu commented 3 years ago

I have the same problem, but when I read the paper, it seems that it is pre training and then fine-tuning on the resize module, so I changed the Pretrain resne.ckpt of epoch 250 to imagenette2.ckpt, and then fine-tuning on the resize module of epoch 20, but the result is not different from that of Pretrain ResNet. Is there a problem in my understanding

您好,我首先关闭resize模块进行训练,得到的.ckpt文件作为开启rezize模块的网络的预训练权重加载进去,结果精度下降的很厉害,您知道是什么缘故吗,是我理解的有问题吗?另外,想请教一下如何validation。求回复~

km1562 commented 3 years ago

I have the same problem, but when I read the paper, it seems that it is pre training and then fine-tuning on the resize module, so I changed the Pretrain resne.ckpt of epoch 250 to imagenette2.ckpt, and then fine-tuning on the resize module of epoch 20, but the result is not different from that of Pretrain ResNet. Is there a problem in my understanding

您好,我首先关闭resize模块进行训练,得到的.ckpt文件作为开启rezize模块的网络的预训练权重加载进去,结果精度下降的很厉害,您知道是什么缘故吗,是我理解的有问题吗?另外,想请教一下如何validation。求回复~

我没有下降的很厉害,但是也没有像作者给出来的涨点,持平或者轻微下降0.0几,没有那么夸张,我试了几次,也让几个学弟去尝试了,没有什么效果也没有降低

cherryolg commented 2 years ago

你好,我想直接使用resizer缩放图像,最后可视化缩放结果。可以直接用resizer.py吗,他的输入格式是什么,就是代码中的x?我是直接用cv2.imread读取了图像输入到Resizer,报错residual = self.interpolate(x) TypeError: interpolate() got an unexpected keyword argument 'recompute_scale_factor'求解答

km1562 commented 2 years ago

你好,我想直接使用resizer缩放图像,最后可视化缩放结果。可以直接用resizer.py吗,他的输入格式是什么,就是代码中的x?我是直接用cv2.imread读取了图像输入到Resizer,报错residual = self.interpolate(x) TypeError: interpolate() got an unexpected keyword argument 'recompute_scale_factor'求解答

1 代码中的x仅仅只是特征图 2 你是否正确初始化了resizer这个类? self.interpolate = partial(F.interpolate, scale_factor=self.scale_factor, mode=self.interpolate_mode, align_corners=False, recompute_scale_factor=False)

原类是false,你是否置为了true? 至于详细,请看pytorch官方文档的interpolate,以及python的partial函数