Giter Club home page Giter Club logo

Comments (5)

wZuck avatar wZuck commented on August 30, 2024

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.

MasterWinston avatar MasterWinston commented on August 30, 2024

其实我是想试试先用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.

wZuck avatar wZuck commented on August 30, 2024

请重新pull一下代码,这个问题前几天修复了一下

from libfewshot.

MasterWinston avatar MasterWinston commented on August 30, 2024

您好,我又有新问题了:)。
我想知道MAML方法外层循环中的θ参数更新时对应的代码位置。我能找到的只有MAML.py里的set_forward_adaptation函数,它似乎是在每个episode后对内层参数的更新,得到多个θ' 。我并没有找到根据多个θ'来对θ进行更新的代码块。

Hope your reply!
Thanks!

from libfewshot.

yangcedrus avatar yangcedrus commented on August 30, 2024

MAML的过程内循环更新θ',外循环通过θ'更新θ。

其中内循环通过手动更新的方式进行的原因是如果内循环使用pytorch的optimizer进行更新,pytorch不可避免地会进行梯度释放等操作,难以处理。但是外循环θ的更新,可以直接使用pytorch的optimizer进行更新,这一步和其他的方法并没有什么不同,因此封装在了trainer.py中。

因此maml.py中并没有外循环更新的代码。

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.