doc-doc / NExT-QA

NExT-QA: Next Phase of Question-Answering to Explaining Temporal Actions (CVPR'21)
MIT License
124 stars 11 forks source link

cannot import fusions #1

Open datar001 opened 3 years ago

datar001 commented 3 years ago

Hi, Thanks for you share. It's a beautiful work. But it seems to have a problem when i run this code.

Traceback (most recent call last): File "main_qa.py", line 1, in from videoqa import * File "/media/ubuntu/HDD/zcy/NExT-QA-main/videoqa.py", line 2, in from networks.VQAModel import EVQA, STVQA, CoMem, HME, HGA File "/media/ubuntu/HDD/zcy/NExT-QA-main/networks/VQAModel/HGA.py", line 7, in from block import fusions #pytorch >= 1.1.0 ImportError: cannot import name 'fusions'

It seems to be lack of a file named 'block.py' in the network folder.

doc-doc commented 3 years ago

Hi, please make sure you have successfully installed the following two libs:

block==0.0.5 block.bootstrap.pytorch==0.1.6

datar001 commented 3 years ago

Hi, please make sure you have successfully installed the following two libs:

block==0.0.5 block.bootstrap.pytorch==0.1.6

datar001 commented 3 years ago

I have installed these libs: image

And I install all libs according to the requirements.txt.

doc-doc commented 3 years ago

Okay, are you using the right env for this repo? You can also check by vim a clean '.py' file and test:

from block import fusions

If it throws errors, then you have to re-install the libs.

datar001 commented 3 years ago

The environment was achieved by the guidance in this repo. It seems to be right. python 3.6.8, torch1.6.0 I test this line in the python console and it also outputs the mistake. image

Then i re-install the libs, it still outputs this mistake. image

doc-doc commented 3 years ago

Not sure the problem here, perhaps you have to create a new env and setup the environment strictly following my guideline.

datar001 commented 3 years ago

I have solved this problem just now. It seems to be caused by pip resource. When I re-install block and block.bootstrap.pytorch from mirrors.aliyun.com/pypi/simple rather than pypi.tuna.tsinghua.edu.cn/simple, this code runs well.

doc-doc commented 3 years ago

Great.

andlyu commented 2 years ago

@datar001, could you share the commands you used to "re-install block and block.bootstrap.pytorch from mirrors.aliyun.com/pypi/simple" ?

-Thanks for the discussion

doc-doc commented 2 years ago

Pls try this:

pip install -i https://mirrors.aliyun.com/pypi/simple block==0.0.5

pip install -i https://mirrors.aliyun.com/pypi/simple block.bootstrap.pytorch==0.1.6
andlyu commented 2 years ago

Thanks. I had to first install block and then block.bootstrap.pytorch from https://mirrors.aliyun.com/pypi/simple before loading from requirements.txt. (block and block.bootstrap.pytorch were commented out) And then it worked. Thanks again.

RedContritio commented 1 year ago

I found it's possible that block.bootstrap.pytorch is shadowed by package block, but there is no fusions in block package.

As a solution:

  1. uninstall block and block.bootstrap.pytorch first.
  2. install from source

then fusions can be found.

Suggestions

I think block may be not necessary in project, while block.bootstrap.pytorch is installed, so maybe remove it from requirements is a better choice.