YapengTian / TDAN-VSR-CVPR-2020

TDAN: Temporally-Deformable Alignment Network for Video Super-Resolution, CVPR 2020
MIT License
400 stars 62 forks source link

Setting up the environment in 2021 #46

Open dzy1997 opened 3 years ago

dzy1997 commented 3 years ago

I am trying to run TDAN for the baseline of a competition, but has some problem setting up the environment. I tried to create an environment in conda: conda create -n tdan python=3.6 pytorch=0.3.1 but got the following error: `UnsatisfiableError: The following specifications were found to be incompatible with each other:

Output in format: Requested package -> Available versions

Package python conflicts for: pytorch=0.3.1 -> cffi -> python[version='>=3.7,<3.8.0a0|>=3.9,<3.10.0a0|>=3.8,<3.9.0a0'] pytorch=0.3.1 -> python[version='>=2.7,<2.8.0a0|>=3.6,<3.7.0a0|>=3.5,<3.6.0a0'] python=3.6` It seems that cffi only works with python 3.7+. Is there a way I can work around this? Any help is appreciated!

YapengTian commented 3 years ago

Python version should not be an issue. So, python 3.7 is fine.

dzy1997 commented 3 years ago

I tried for several times but installing pytorch 0.3.1 in a python 3.7 (anaconda) environment would just fail. Can you share your channel choice for installing python packages?

YapengTian commented 3 years ago

Could you first create a python environment and then install Pytorch?

dzy1997 commented 3 years ago

Yes that's what I've tried. I first created an (conda) environment with python 3.7 then tried to install pytorch 0.3.1. It didn't work. Here's part of the output: `UnsatisfiableError: The following specifications were found to be incompatible with the existing python installation in your environment:

Specifications:

Your python: python=3.7`

YapengTian commented 3 years ago

It is really weird. Could you try a different python version? I used Python 3.6.

dzy1997 commented 3 years ago

Ok so I tried to create a new environment with Python 3.6 and install Pytorch 0.3.1. It gave me the following message:

UnsatisfiableError: The following specifications were found to be incompatible with the existing python installation in your environment:

Specifications:

Your python: python=3.6

It seems that under conda environment some part of pytorch0.3.1 (probably cffi, see my first post) requires python 3.7+, while some other part does not work with python 3.7.

dzy1997 commented 3 years ago

Update: I managed to modify model.py to use the official DCN implementation (torchvision.ops.deform_conv) and get rid of the ffi dependency. However when I try to load model/model.pt, ffi is still required. Is there a way one could modify the key names in the state dict of model.pt file to match with the official DCN implementation?

YapengTian commented 3 years ago

It is possible. You might extract the offsets and weights of each deformable conv layer and feed them to torchvision.ops.deform_conv.

Ceeeeeeeeb commented 3 years ago

Ok so I tried to create a new environment with Python 3.6 and install Pytorch 0.3.1. It gave me the following message:

UnsatisfiableError: The following specifications were found to be incompatible with the existing python installation in your environment:

Specifications:

  • pytorch=0.3.1 -> python[version='>=3.7,<3.8.0a0|>=3.8,<3.9.0a0|>=3.9,<3.10.0a0']

Your python: python=3.6

It seems that under conda environment some part of pytorch0.3.1 (probably cffi, see my first post) requires python 3.7+, while some other part does not work with python 3.7.

Hey man,I think maybe you should try installing use the whl file,I'd like to show you my choice,click this page:"https://download.pytorch.org/whl/cu90/torch_stable.html"and choose the proper whl file you need.