Giter VIP home page Giter VIP logo

Comments (5)

one-molamola avatar one-molamola commented on May 26, 2024

I have solved this problem, but I have a new problem, I want to know what the extracted image feature dimension is 2048 (10-100)?

Because when I use the extracted image features to train the model, the following problem arises

RuntimeError: stack expects each tensor to be equal size, but got [100, 10] at entry 0 and [100, 18] at entry 1

from bottom-up-features.

violetteshev avatar violetteshev commented on May 26, 2024

Hi. It outputs 10-100 features (1 for each detected object), so the value will differ for each image.

from bottom-up-features.

one-molamola avatar one-molamola commented on May 26, 2024

So how do I use these features in the dataloader function? Because the following error was reported in the program

Traceback (most recent call last):
File "E:/vizwiz-vqa/mcan-vqa-master/run.py", line 155, in
execution.run(__C.RUN_MODE)
File "E:\vizwiz-vqa\mcan-vqa-master\core\exec.py", line 513, in run
self.train(self.dataset, self.dataset_eval)
File "E:\vizwiz-vqa\mcan-vqa-master\core\exec.py", line 149, in train
for step, (
File "C:\Users\KAI.conda\envs\fw\lib\site-packages\torch\utils\data\dataloader.py", line 521, in next
data = self._next_data()
File "C:\Users\KAI.conda\envs\fw\lib\site-packages\torch\utils\data\dataloader.py", line 561, in _next_data
data = self._dataset_fetcher.fetch(index) # may raise StopIteration
File "C:\Users\KAI.conda\envs\fw\lib\site-packages\torch\utils\data_utils\fetch.py", line 52, in fetch
return self.collate_fn(data)
File "C:\Users\KAI.conda\envs\fw\lib\site-packages\torch\utils\data_utils\collate.py", line 84, in default_collate
return [default_collate(samples) for samples in transposed]
File "C:\Users\KAI.conda\envs\fw\lib\site-packages\torch\utils\data_utils\collate.py", line 84, in
return [default_collate(samples) for samples in transposed]
File "C:\Users\KAI.conda\envs\fw\lib\site-packages\torch\utils\data_utils\collate.py", line 56, in default_collate
return torch.stack(batch, 0, out=out)
RuntimeError: stack expects each tensor to be equal size, but got [100, 14] at entry 0 and [100, 11] at entry 1

进程已结束,退出代码1

from bottom-up-features.

one-molamola avatar one-molamola commented on May 26, 2024

Can you provide some reference code to load these features?

from bottom-up-features.

violetteshev avatar violetteshev commented on May 26, 2024

You can pad all the features to the max size (100 in this case) with 0. That's what they do in the original MCAN model: code (in proc_img_feat function)

from bottom-up-features.

Related Issues (18)

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.