Giter Club home page Giter Club logo

Comments (9)

wZuck avatar wZuck commented on August 30, 2024

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

from libfewshot.

Aquariuaa avatar Aquariuaa commented on August 30, 2024

在我的版本中已经修改为了
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)

from libfewshot.

wZuck avatar wZuck commented on August 30, 2024

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

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

from libfewshot.

Aquariuaa avatar Aquariuaa commented on August 30, 2024

感谢您的回答!
经过对比,是一致的。同时我也尝试拉取了最新版本的代码,仍然报此错误。在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])],)

from libfewshot.

wZuck avatar wZuck commented on August 30, 2024

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

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

from libfewshot.

Aquariuaa avatar Aquariuaa commented on August 30, 2024

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

from libfewshot.

wZuck avatar wZuck commented on August 30, 2024

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

from libfewshot.

Aquariuaa avatar Aquariuaa commented on August 30, 2024

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

from libfewshot.

wZuck avatar wZuck commented on August 30, 2024

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

from libfewshot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.