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

在miniImageNet数据集上运行RENet等报错 #63

Closed
Aquariuaa opened this issue Nov 14, 2022 · 9 comments
Closed

在miniImageNet数据集上运行RENet等报错 #63

Aquariuaa opened this issue Nov 14, 2022 · 9 comments

Comments

@Aquariuaa
Copy link

(torchLFS) [inspur@localhost LibFewShot-main]$ python run_trainer.py
[11/14/22 10:04:36] INFO {'data_root': '/home/inspur/MAX_SPACE/Jiyu/LibFewShot-main/dataset_floder/miniImgFSL', 'image_size': 84, 'use_memory': False, 'augment': trainer.py:372
False, 'augment_times': 1, 'augment_times_query': 1, 'workers': 2, 'dataloader_num': 1, 'device_ids': 0, 'n_gpu': 1, 'seed': 2147483647,
'deterministic': True, 'port': 53758, 'log_name': None, 'log_level': 'info', 'log_interval': 100, 'log_paramerter': False, 'result_root':
'./results', 'save_interval': 10, 'save_part': ['emb_func'], 'tag': None, 'epoch': 5, 'test_epoch': 5, 'parallel_part': ['emb_func'],
'pretrain_path': None, 'resume': False, 'way_num': 5, 'shot_num': 1, 'query_num': 15, 'test_way': 5, 'test_shot': 1, 'test_query': 15,
'episode_size': 1, 'train_episode': 100, 'test_episode': 100, 'batch_size': 128, 'val_per_epoch': 1, 'optimizer': {'name': 'Adam',
'kwargs': {'lr': 0.01}, 'other': None}, 'lr_scheduler': {'name': 'StepLR', 'kwargs': {'gamma': 1.0, 'step_size': 20}}, 'warmup': 0,
'includes': ['headers/data.yaml', 'headers/device.yaml', 'headers/misc.yaml', 'headers/model.yaml', 'headers/optimizer.yaml',
'classifiers/RENet.yaml', 'backbones/resnet18.yaml'], 'classifier': {'name': 'RENet', 'kwargs': {'feat_dim': 512, 'lambda_epi': 0.25,
'temperature': 0.2, 'temperature_attn': 5.0, 'num_classes': 2}}, 'backbone': {'name': 'resnet18', 'kwargs': {'is_feature': False,
'avg_pool': True, 'is_flatten': True}}, 'tb_scale': 1.0, 'rank': 0}
[11/14/22 10:04:37] INFO RENet( trainer.py:372
(emb_func): ResNet(
(conv1): Conv2d(3, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
(bn1): BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(relu): ReLU(inplace=True)
(layer1): Sequential(
(0): BasicBlock(
(conv1): Conv2d(64, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
(bn1): BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(relu): ReLU(inplace=True)
(conv2): Conv2d(64, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
(bn2): BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
)
(1): BasicBlock(
(conv1): Conv2d(64, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
(bn1): BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(relu): ReLU(inplace=True)
(conv2): Conv2d(64, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
(bn2): BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
)
)
(layer2): Sequential(
(0): BasicBlock(
(conv1): Conv2d(64, 128, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), bias=False)
(bn1): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(relu): ReLU(inplace=True)
(conv2): Conv2d(128, 128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
(bn2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(downsample): Sequential(
(0): Conv2d(64, 128, kernel_size=(1, 1), stride=(2, 2), bias=False)
(1): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
)
)
(1): BasicBlock(
(conv1): Conv2d(128, 128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
(bn1): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(relu): ReLU(inplace=True)
(conv2): Conv2d(128, 128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
(bn2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
)
)
(layer3): Sequential(
(0): BasicBlock(
(conv1): Conv2d(128, 256, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), bias=False)
(bn1): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(relu): ReLU(inplace=True)
(conv2): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
(bn2): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(downsample): Sequential(
(0): Conv2d(128, 256, kernel_size=(1, 1), stride=(2, 2), bias=False)
(1): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
)
)
(1): BasicBlock(
(conv1): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
(bn1): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(relu): ReLU(inplace=True)
(conv2): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
(bn2): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
)
)
(layer4): Sequential(
(0): BasicBlock(
(conv1): Conv2d(256, 512, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), bias=False)
(bn1): BatchNorm2d(512, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(relu): ReLU(inplace=True)
(conv2): Conv2d(512, 512, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
(bn2): BatchNorm2d(512, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(downsample): Sequential(
(0): Conv2d(256, 512, kernel_size=(1, 1), stride=(2, 2), bias=False)
(1): BatchNorm2d(512, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
)
)
(1): BasicBlock(
(conv1): Conv2d(512, 512, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
(bn1): BatchNorm2d(512, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(relu): ReLU(inplace=True)
(conv2): Conv2d(512, 512, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
(bn2): BatchNorm2d(512, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
)
)
(avgpool): AdaptiveAvgPool2d(output_size=(1, 1))
)
(fc): Linear(in_features=512, out_features=2, bias=True)
(scr_layer): SCRLayer(
(model): Sequential(
(0): SelfCorrelationComputation(
(unfold): Unfold(kernel_size=(5, 5), dilation=1, padding=2, stride=1)
(relu): ReLU()
)
(1): SCR(
(conv1x1_in): Sequential(
(0): Conv2d(512, 64, kernel_size=(1, 1), stride=(1, 1), bias=False)
(1): BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(2): ReLU(inplace=True)
)
(conv1): Sequential(
(0): Conv3d(64, 64, kernel_size=(1, 3, 3), stride=(1, 1, 1), bias=False)
(1): BatchNorm3d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(2): ReLU(inplace=True)
)
(conv2): Sequential(
(0): Conv3d(64, 64, kernel_size=(1, 3, 3), stride=(1, 1, 1), bias=False)
(1): BatchNorm3d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(2): ReLU(inplace=True)
)
(conv1x1_out): Sequential(
(0): Conv2d(64, 512, kernel_size=(1, 1), stride=(1, 1), bias=False)
(1): BatchNorm2d(512, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
)
)
)
)
(cca_layer): CCALayer(
(cca_module): CCA(
(conv): Sequential(
(0): SepConv4d(
(proj): Sequential(
(0): Conv2d(1, 16, kernel_size=(1, 1), stride=(1, 1), bias=False)
(1): BatchNorm2d(16, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
)
(conv1): Sequential(
(0): Conv3d(1, 1, kernel_size=(1, 3, 3), stride=(1, 1, 1), padding=(0, 1, 1), bias=False)
(1): BatchNorm3d(1, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
)
(conv2): Sequential(
(0): Conv3d(1, 1, kernel_size=(3, 3, 1), stride=(1, 1, 1), padding=(1, 1, 0), bias=False)
(1): BatchNorm3d(1, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
)
(relu): ReLU(inplace=True)
)
(1): ReLU(inplace=True)
(2): SepConv4d(
(proj): Sequential(
(0): Conv2d(16, 1, kernel_size=(1, 1), stride=(1, 1), bias=False)
(1): BatchNorm2d(1, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
)
(conv1): Sequential(
(0): Conv3d(16, 16, kernel_size=(1, 3, 3), stride=(1, 1, 1), padding=(0, 1, 1), bias=False)
(1): BatchNorm3d(16, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
)
(conv2): Sequential(
(0): Conv3d(16, 16, kernel_size=(3, 3, 1), stride=(1, 1, 1), padding=(1, 1, 0), bias=False)
(1): BatchNorm3d(16, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
)
(relu): ReLU(inplace=True)
)
)
)
(cca_1x1): Sequential(
(0): Conv2d(512, 64, kernel_size=(1, 1), stride=(1, 1), bias=False)
(1): BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(2): ReLU()
)
)
(loss_func): CrossEntropyLoss()
)
INFO Trainable params in the model: 11348186 trainer.py:372
[11/14/22 10:04:40] INFO load 38400 train image with 64 label. trainer.py:372
INFO load 9600 val image with 16 label. trainer.py:372
INFO load 12000 test image with 20 label. trainer.py:372
INFO Adam ( trainer.py:372
Parameter Group 0
amsgrad: False
betas: (0.9, 0.999)
eps: 1e-08
initial_lr: 0.01
lr: 0.01
weight_decay: 0
)
INFO ============ Train on the train set ============ trainer.py:372
INFO learning rate: [0.01] trainer.py:372
Traceback (most recent call last):
File "run_trainer.py", line 24, in
main(0, config)
File "run_trainer.py", line 14, in main
trainer.train_loop(rank)
File "/home/inspur/MAX_SPACE/Jiyu/LibFewShot-main/core/trainer.py", line 83, in train_loop
train_acc = self._train(epoch_idx)
File "/home/inspur/MAX_SPACE/Jiyu/LibFewShot-main/core/trainer.py", line 170, in _train
[elem for each_batch in batch for elem in each_batch]
File "/home/inspur/anaconda3/envs/torchLFS/lib/python3.7/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/inspur/MAX_SPACE/Jiyu/LibFewShot-main/core/model/abstract_model.py", line 30, in forward
return self.set_forward_loss(x)
File "/home/inspur/MAX_SPACE/Jiyu/LibFewShot-main/core/model/finetuning/renet.py", line 415, in set_forward_loss
) = batch # RENet uses both episode and general dataloaders
ValueError: not enough values to unpack (expected 4, got 2)

@wZuck
Copy link
Member

wZuck commented Nov 15, 2022

Please ensure that you have pull the latest commit ee25973, we have fix this problem in this version.

@wZuck wZuck closed this as completed Nov 15, 2022
@Aquariuaa
Copy link
Author

在我的版本中已经修改为了
if config["dataloader_num"] == 1 or mode in ["val", "test"]:
但是仍然报此错误:
File "/home/inspur/MAX_SPACE/Jiyu/LibFewShot-main/core/model/finetuning/renet.py", line 416, in set_forward_loss
) = batch # RENet uses both episode and general dataloaders
ValueError: not enough values to unpack (expected 4, got 2)

@wZuck
Copy link
Member

wZuck commented Nov 15, 2022

你的代码应该不是最新的版本,我的意思不是按照 ee25973 修改。你可以比对一下你使用的代码中该片段是否和

[elem for each_batch in batch for elem in each_batch]
一致。如果不是的话,请重新拉取现在的代码版本并重新测试。如仍有问题,欢迎继续讨论。

@Aquariuaa
Copy link
Author

感谢您的回答!
经过对比,是一致的。同时我也尝试拉取了最新版本的代码,仍然报此错误。在miniImageNet数据集上,我使用5way1shot+resnet18+RENet的方式进行训练,参数参考了reproduce中的参数设置。
我打印了[elem for each_batch in batch for elem in each_batch]中的我的batch,打印结果如下:

batch:([tensor([[[[ 0.4896, 0.9282, 0.9423, ..., -1.3355, -1.6043, -1.3638], trainer.py:375
[ 0.9282, 1.1545, 0.7584, ..., -1.4628, -1.4770, -1.3638],
[ 1.1687, 1.2536, 0.9989, ..., -1.5336, -1.4062, -1.1233],
...,
[-1.0525, -0.9960, -0.9535, ..., -1.0950, -1.0667, -1.0384],
[-0.9535, -1.1091, -1.1940, ..., -1.2648, -1.0384, -1.1516],
[-1.4487, -0.9677, -1.0101, ..., -1.2506, -1.1657, -1.2082]],

                                  [[-0.7703, -0.5506, -1.2390,  ..., -0.6385, -0.5506, -0.6385],                                                                                 
                                   [-1.1804, -1.0339, -1.5026,  ..., -0.7996, -0.7410, -0.6531],                                                                                 
                                   [-1.2390, -1.5173, -1.3122,  ..., -1.0632, -0.9461, -0.1845],                                                                                 
                                   ...,                                                                                                                                          
                                   [-0.0819, -0.1845, -0.0966,  ...,  0.0352, -0.2430, -0.2870],                                                                                 
                                   [-0.0380, -0.4041, -0.3895,  ..., -0.1112, -0.3456, -0.4627],                                                                                 
                                   [-0.6824, -0.4188, -0.3016,  ...,  0.1671, -0.0380,  0.0206]],                                                                                
                                                                                                                                                                                 
                                  [[ 0.3923, -0.1866,  0.2958,  ...,  0.9437,  0.8472,  0.8885],                                                                                 
                                   [-0.4348, -0.3245, -0.5037,  ...,  0.8334,  0.7783,  0.4750],                                                                                 
                                   [-0.4348, -0.2694, -0.6829,  ...,  0.6818,  0.7921,  0.9437],                                                                                 
                                   ...,                                                                                                                                          
                                   [ 1.1367,  0.8748,  1.0402,  ...,  1.0815,  1.0677,  1.1505],                                                                                 
                                   [ 1.2469,  0.7507,  0.8058,  ...,  0.8885,  0.9575,  0.8885],                                                                                 
                                   [ 0.7231,  0.8334,  0.9575,  ...,  0.9988,  0.9437,  0.9850]]],                                                                               
                                                                                                                                                                                 
                                                                                                                                                                                 
                                 [[[-1.7033, -1.7033, -1.7033,  ..., -1.7033, -1.7033, -1.7033],                                                                                 
                                   [-1.7033, -1.7033, -1.7033,  ..., -1.7033, -1.7033, -1.7033],                                                                                 
                                   [-1.7033, -1.7033, -1.7033,  ..., -1.7033, -1.7033, -1.7033],                                                                                 
                                   ...,                                                                                                                                          
                                   [-1.7033, -1.7033, -1.7033,  ..., -1.7033, -1.7033, -1.7033],                                                                                 
                                   [-1.7033, -1.7033, -1.7033,  ..., -1.7033, -1.7033, -1.7033],                                                                                 
                                   [-1.7033, -1.7033, -1.7033,  ..., -1.7033, -1.7033, -1.7033]],                                                                                
                                                                                                                                                                                 
                                  [[-1.6930, -1.6930, -1.6930,  ..., -1.6930, -1.6930, -1.6930],                                                                                 
                                   [-1.6930, -1.6930, -1.6930,  ..., -1.6930, -1.6930, -1.6930],                                                                                 
                                   [-1.6930, -1.6930, -1.6930,  ..., -1.6930, -1.6930, -1.6930],                                                                                 
                                   ...,                                                                                                                                          
                                   [-1.6930, -1.6930, -1.6930,  ..., -1.6930, -1.6930, -1.6930],                                                                                 
                                   [-1.6930, -1.6930, -1.6930,  ..., -1.6930, -1.6930, -1.6930],                                                                                 
                                   [-1.6930, -1.6930, -1.6930,  ..., -1.6930, -1.6930, -1.6930]],                                                                                
                                                                                                                                                                                 
                                  [[-1.4410, -1.4410, -1.4410,  ..., -1.4410, -1.4410, -1.4410],                                                                                 
                                   [-1.4410, -1.4410, -1.4410,  ..., -1.4410, -1.4410, -1.4410],                                                                                 
                                   [-1.4410, -1.4410, -1.4410,  ..., -1.4410, -1.4410, -1.4410],                                                                                 
                                   ...,                                                                                                                                          
                                   [-1.4410, -1.4410, -1.4410,  ..., -1.4410, -1.4410, -1.4410],                                                                                 
                                   [-1.4410, -1.4410, -1.4410,  ..., -1.4410, -1.4410, -1.4410],                                                                                 
                                   [-1.4410, -1.4410, -1.4410,  ..., -1.4410, -1.4410, -1.4410]]],                                                                               
                                                                                                                                                                                 
                                                                                                                                                                                 
                                 [[[-0.1471, -0.3452, -0.4300,  ...,  0.2632,  0.2915,  0.3198],                                                                                 
                                   [-0.4017, -0.4583, -0.4583,  ...,  0.3339,  0.3481,  0.3622],                                                                                 
                                   [ 0.2491, -0.3734, -0.1188,  ...,  0.3764,  0.3905,  0.4047],                                                                                 
                                   ...,                                                                                                                                          
                                   [-0.7696, -0.7696, -0.7696,  ..., -0.0763, -0.0339, -0.0763],                                                                                 
                                   [-0.7837, -0.7837, -0.7837,  ..., -0.0622, -0.0763, -0.0905],                                                                                 
                                   [-0.8120, -0.8120, -0.7979,  ..., -0.0905, -0.1046, -0.1188]],                                                                                
                                                                                                                                                                                 
                                  [[ 0.0352, -0.1991, -0.3163,  ...,  0.5332,  0.5625,  0.5625],                                                                                 
                                   [-0.2577, -0.3309, -0.3602,  ...,  0.6065,  0.6211,  0.6065],                                                                                 
                                   [ 0.3868, -0.2723, -0.0233,  ...,  0.6504,  0.6650,  0.6504],                                                                                 
                                   ...,                                                                                                                                          
                                   [-0.4188, -0.4188, -0.4041,  ...,  0.3868,  0.4307,  0.3868],                                                                                 
                                   [-0.3895, -0.3895, -0.3895,  ...,  0.4161,  0.4014,  0.3868],                                                                                 
                                   [-0.4188, -0.4188, -0.4041,  ...,  0.3868,  0.3721,  0.3575]],                                                                                
                                                                                                                                                                                 
                                  [[-0.3107, -0.4486, -0.4072,  ...,  0.0477,  0.0753,  0.1028],                                                                                 
                                   [-0.4210, -0.4348, -0.3658,  ...,  0.1166,  0.1304,  0.1304],                                                                                 
                                   [ 0.3923, -0.2004,  0.0615,  ...,  0.1580,  0.1718,  0.1718],                                                                                 
                                   ...,                                                                                                                                          
                                   [-0.6415, -0.6415, -0.6415,  ..., -0.0764, -0.0212, -0.0626],                                                                                 
                                   [-0.6553, -0.6553, -0.6553,  ...,  0.0063, -0.0212, -0.0350],                                                                                 
                                   [-0.6829, -0.6829, -0.6691,  ..., -0.0212, -0.0488, -0.0626]]],                                                                               
                                                                                                                                                                                 
                                                                                                                                                                                 
                                 ...,                                                                                                                                            
                                                                                                                                                                                 
                                                                                                                                                                                 
                                 [[[ 0.0510,  0.4613,  0.4330,  ..., -0.0763,  0.6311,  1.1970],                                                                                 
                                   [-0.1612,  0.1925,  0.2632,  ..., -0.0197,  0.5745,  1.0979],                                                                                 
                                   [-0.1188,  0.1925,  0.6169,  ..., -0.2744,  0.1359,  0.5037],                                                                                 
                                   ...,                                                                                                                                          
                                   [ 0.0793,  0.2632,  0.5320,  ...,  0.7584,  0.4896,  0.4754],                                                                                 
                                   [-0.0056,  0.1783,  0.4754,  ...,  0.8574,  0.6028,  0.5745],                                                                                 
                                   [ 0.0793,  0.1925,  0.4188,  ...,  0.8008,  0.6311,  0.6028]],                                                                                
                                                                                                                                                                                 
                                  [[-0.4627,  0.0060,  0.0938,  ..., -0.9607, -0.2870,  0.2403],                                                                                 
                                   [-0.5213, -0.1112,  0.0645,  ..., -0.9168, -0.3749,  0.1231],                                                                                 
                                   [-0.1991,  0.1524,  0.6650,  ..., -1.2243, -0.8582, -0.5067],                                                                                 
                                   ...,                                                                                                                                          
                                   [-1.0046, -0.8142, -0.5653,  ..., -0.5653, -0.8582, -0.8875],                                                                                 
                                   [-1.0779, -0.8875, -0.6092,  ..., -0.4627, -0.7410, -0.7996],                                                                                 
                                   [-0.9900, -0.8728, -0.6531,  ..., -0.5360, -0.7264, -0.7557]],                                                                                
                                                                                                                                                                                 
                                  [[-0.5588, -0.0902, -0.0074,  ..., -0.8621, -0.2418,  0.2545],                                                                                 
                                   [-0.6277, -0.2280, -0.0488,  ..., -0.8345, -0.3245,  0.1304],                                                                                 
                                   [-0.3521, -0.0074,  0.4888,  ..., -1.1516, -0.8207, -0.5037],                                                                                 
                                   ...,                                                                                                                                          
                                   [-1.3583, -1.1929, -0.9448,  ..., -0.9172, -1.1516, -1.1653],                                                                                 
                                   [-1.4410, -1.3032, -1.0413,  ..., -0.8345, -1.0826, -1.1102],                                                                                 
                                   [-1.4273, -1.3170, -1.1102,  ..., -0.9034, -1.0689, -1.0964]]],                                                                               
                                                                                                                                                                                 
                                                                                                                                                                                 
                                 [[[ 0.5603,  0.6028,  0.6311,  ..., -1.0950, -1.0950, -1.0950],                                                                                 
                                   [ 0.5745,  0.5886,  0.6028,  ..., -1.0667, -1.0667, -1.0808],                                                                                 
                                   [ 0.5886,  0.5886,  0.5745,  ..., -1.0808, -1.0950, -1.0950],                                                                                 
                                   ...,                                                                                                                                          
                                   [-1.0667, -1.0384, -1.0384,  ..., -1.4345, -1.4345, -1.4345],                                                                                 
                                   [-1.0808, -1.0667, -1.0808,  ..., -1.4204, -1.4345, -1.4345],                                                                                 
                                   [-1.0242, -1.0101, -1.0384,  ..., -1.4487, -1.4487, -1.4487]],                                                                                
                                                                                                                                                                                 
                                  [[ 0.0499,  0.0938,  0.1231,  ..., -1.1950, -1.1804, -1.1658],                                                                                 
                                   [ 0.0645,  0.0792,  0.0938,  ..., -1.1658, -1.1658, -1.1511],                                                                                 
                                   [ 0.0792,  0.0792,  0.0645,  ..., -1.1950, -1.1950, -1.1950],                                                                                 
                                   ...,                                                                                                                                          
                                   [-1.1218, -1.1072, -1.1072,  ..., -1.4294, -1.4294, -1.4294],                                                                                 
                                   [-1.1072, -1.1365, -1.1511,  ..., -1.4147, -1.4294, -1.4294],                                                                                 
                                   [-1.0486, -1.0779, -1.1072,  ..., -1.4440, -1.4440, -1.4440]],                                                                                
                                                                                                                                                                                 
                                  [[-1.0275, -0.9999, -0.9724,  ..., -1.0689, -1.0689, -1.0826],                                                                                 
                                   [-1.0275, -1.0137, -0.9999,  ..., -1.0137, -1.0413, -1.0689],                                                                                 
                                   [-1.0137, -1.0275, -1.0413,  ..., -1.0275, -1.0551, -1.0689],                                                                                 
                                   ...,                                                                                                                                          
                                   [-0.9999, -0.9724, -0.9861,  ..., -1.2205, -1.2205, -1.2205],                                                                                 
                                   [-1.0137, -1.0275, -1.0413,  ..., -1.2067, -1.2205, -1.2205],                                                                                 
                                   [-0.9586, -0.9724, -0.9999,  ..., -1.2343, -1.2343, -1.2343]]],                                                                               
                                                                                                                                                                                 
                                                                                                                                                                                 
                                 [[[ 0.5745,  0.0085, -0.1188,  ...,  0.3905,  0.7442,  0.6452],                                                                                 
                                   [ 0.5745,  0.2208, -0.0763,  ...,  0.3764,  0.7159,  0.6028],                                                                                 
                                   [ 0.6028,  0.4188, -0.0622,  ...,  0.3764,  0.6876,  0.5603],                                                                                 
                                   ...,                                                                                                                                          
                                   [ 1.0838,  1.4799,  1.5082,  ..., -0.4442, -0.5715, -0.5715],                                                                                 
                                   [ 0.8008,  1.1262,  1.5365,  ..., -0.5998, -0.4017, -0.5149],                                                                                 
                                   [ 0.8433,  0.8150,  1.2677,  ..., -0.9818, -0.4725, -0.4300]],                                                                                
                                                                                                                                                                                 
                                  [[ 0.1964, -0.3895, -0.4774,  ..., -0.0673,  0.1671,  0.0499],                                                                                 
                                   [ 0.1964, -0.1698, -0.4334,  ..., -0.0819,  0.1378,  0.0060],                                                                                 
                                   [ 0.1964,  0.0206, -0.4481,  ..., -0.0673,  0.1231, -0.0233],                                                                                 
                                   ...,                                                                                                                                          
                                   [ 0.4746,  0.8994,  1.0019,  ..., -0.7557, -0.8435, -0.8289],                                                                                 
                                   [ 0.1231,  0.4746,  0.9726,  ..., -0.8289, -0.6678, -0.7850],                                                                                 
                                   [ 0.1085,  0.1231,  0.6504,  ..., -1.0925, -0.6824, -0.6531]],                                                                                
                                                                                                                                                                                 
                                  [[-0.3107, -0.7656, -0.7380,  ..., -0.5726, -0.3796, -0.5175],                                                                                 
                                   [-0.2969, -0.5726, -0.7105,  ..., -0.5864, -0.4210, -0.5588],                                                                                 
                                   [-0.3107, -0.4210, -0.7518,  ..., -0.5313, -0.4486, -0.5864],                                                                                 
                                   ...,                                                                                                                                          
                                   [-0.2142,  0.1855,  0.2958,  ..., -0.9310, -0.9861, -0.9724],                                                                                 
                                   [-0.4899, -0.1591,  0.3234,  ..., -0.9172, -0.8207, -0.9310],                                                                                 
                                   [-0.4348, -0.4348,  0.0615,  ..., -1.1102, -0.7794, -0.7794]]]]), tensor([ 6, 43, 47, 63, 37, 28, 25, 60, 30, 40, 47, 44, 29,                 
                         53, 17, 62, 31, 52,                                                                                                                                     
                                 40, 33, 29, 29, 48, 61, 10,  8, 21, 10, 24, 35,  2, 22,  0, 47, 22,  2,                                                                         
                                 38,  8, 57, 39,  7, 38, 61, 22, 60,  1,  1, 33, 33, 51, 20, 61, 46, 24,                                                                         
                                 50, 52, 37, 29, 37, 25, 27, 62, 13, 32, 48, 40,  7, 37, 48, 33, 61,  5,                                                                         
                                  3, 19, 28, 21, 56, 32, 27, 40,  9, 38,  7, 33,  7, 48, 48, 33, 59, 18,                                                                         
                                 59, 37, 39, 56, 26,  7, 10, 48, 46, 30, 63, 28, 49, 54, 10, 38, 35, 47,                                                                         
                                 14,  2, 52, 59,  8, 21, 49, 40, 34, 18, 20, 58, 18, 27,  4, 63, 57, 36,                                                                         
                                 24, 63])],)

@wZuck
Copy link
Member

wZuck commented Nov 15, 2022

你好,我按照下面的步骤尝试训练renet,但没有报错,或许可以供你参考:

git clone https://github.com/RL-VIG/LibFewShot.git LibFewShot_ee25973
cd LibFewShot_ee25973
# 修改renet.config 和 run_trainer.py

@Aquariuaa
Copy link
Author

十分感谢,未找到renet.config,请问是config/classifiers/RENet.yaml吗?

@wZuck
Copy link
Member

wZuck commented Nov 15, 2022

是config/renet.yaml,刚刚写错了,抱歉。

@Aquariuaa
Copy link
Author

非常感谢,经过多次尝试,使用Conv64F可以正常使用,但是使用resnet18无法跑通。感谢帮助

@wZuck
Copy link
Member

wZuck commented Nov 15, 2022

换Backbone的话需要对应修改分类头参数,分类头参数可以推导或者参考原文,可以附上更详细的报错信息供我们提供解决方案。

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