Comments (5)
Yes, you need to process your dataset in such a format and set the data_root
to the folder. Notice that the format of your *.csv should be the same as miniimagenet. When training/testing on your dataset, you should make sure your dataset can handle your setting.(for example, if there are only 4 classes in your dataset, you should set way_num <=4)
Another solution is to modify the core/data/dataset.py
to read your dataset.
from libfewshot.
其实我是想试试先用miniImagenet训练得到一个不错的model,然后再用这个model在自己的数据集上测试。
另外我刚跑run_test.py代码报了如下错误:
Traceback (most recent call last):
File "E:/Desktop/fewshot/LibFewShot/run_test.py", line 27, in
main(0, config)
File "E:/Desktop/fewshot/LibFewShot/run_test.py", line 22, in main
test.test_loop()
File "E:\Desktop\fewshot\LibFewShot\core\test.py", line 61, in test_loop
_, accuracies = self._validate(epoch_idx)
File "E:\Desktop\fewshot\LibFewShot\core\test.py", line 104, in _validate
prefetcher = data_prefetcher(self.test_loader)
File "E:\Desktop\fewshot\LibFewShot\core\utils\utils.py", line 303, in init
self.preload()
File "E:\Desktop\fewshot\LibFewShot\core\utils\utils.py", line 313, in preload
self.next_data = [data.cuda(non_blocking=True) for data in self.next_data]
File "E:\Desktop\fewshot\LibFewShot\core\utils\utils.py", line 313, in
self.next_data = [data.cuda(non_blocking=True) for data in self.next_data]
AttributeError: 'list' object has no attribute 'cuda'
请问这是什么原因呢?
ps:run_trainer.py已成功跑完。
from libfewshot.
请重新pull一下代码,这个问题前几天修复了一下
from libfewshot.
您好,我又有新问题了:)。
我想知道MAML方法外层循环中的θ参数更新时对应的代码位置。我能找到的只有MAML.py里的set_forward_adaptation函数,它似乎是在每个episode后对内层参数的更新,得到多个θ' 。我并没有找到根据多个θ'来对θ进行更新的代码块。
Hope your reply!
Thanks!
from libfewshot.
MAML的过程内循环更新θ',外循环通过θ'更新θ。
其中内循环通过手动更新的方式进行的原因是如果内循环使用pytorch的optimizer进行更新,pytorch不可避免地会进行梯度释放等操作,难以处理。但是外循环θ的更新,可以直接使用pytorch的optimizer进行更新,这一步和其他的方法并没有什么不同,因此封装在了trainer.py中。
因此maml.py中并没有外循环更新的代码。
from libfewshot.
Related Issues (20)
- 数据集划分规范问题 HOT 2
- RuntimeError: shape '[-1, 3, 16]' is invalid for input of size 30 HOT 2
- train,val和test类别问题 HOT 7
- How to use this code into open-set recognition? HOT 1
- 使用自己数据集的时候会卡在加载训练数据集这一步 HOT 1
- https://github.com/RL-VIG/LibFewShot.git
- The computer does not have cuda, and it will report an error when running. HOT 1
- 5way-5shot报错 HOT 9
- 报错:/LibFewShot/core/data/samplers.py", line 111, in __iter__ batch = torch.stack(batch).reshape(-1) RuntimeError: stack expects each tensor to be equal size, but got [16] at entry 0 and [7] at entry 2 HOT 14
- 不管怎么搭配,程序都报错啊 HOT 1
- 请问怎么可以对一张图片进行分类? HOT 2
- 使用miniImageNet--ravi数据集,然后ACC值为什么这么低? HOT 5
- RENet HOT 1
- renet.yaml的backbone为ViT时的报错解决 HOT 1
- 训练日志与run_test的test数据差距过大 HOT 2
- 关于deepbdc方法的咨询 HOT 2
- use_logger() got an unexpected keyword argument 'file' HOT 1
- 使用时报错too many values to unpack
- 在复现文件夹`reproduce/`中缺失部分 method 的 config,详情见图 HOT 5
- 论文复现成功后,提交pr会同意吗QAQ HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libfewshot.