baowenbo / DAIN

Depth-Aware Video Frame Interpolation (CVPR 2019)
https://sites.google.com/view/wenbobao/dain
MIT License
8.19k stars 840 forks source link

Does not install on Ubuntu 20.04 #123

Closed lgmventura closed 3 years ago

lgmventura commented 3 years ago

Following the installation instructions I ran out into an error that there must be a Conda environment called pytorch1.0.0 after running ./build.sh – this is not mentioned in the compilation instructions. Well, I created a Conda environment called pytorch1.0.0 and installed pytorch v1.4.0 (I saw on issue #118 that newer versions of pytorch aren't compatible, this is also not on the instructions) and ran build.sh again. Now, I come to:

(pytorch1.0.0) luiz@luiz-Aspire-V3-772:[/media/luiz/Volume/Downloads/DAIN/my_package]: ./build.sh
Need pytorch>=1.0.0
./build.sh: line 4: activate: No such file or directory
Traceback (most recent call last):
  File "setup.py", line 16, in <module>
    ], extra_compile_args={'cxx': cxx_args, 'nvcc': nvcc_args})
  File "/media/luiz/Volume/anaconda3/envs/pytorch1.0.0/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 498, in CUDAExtension
    library_dirs += library_paths(cuda=True)
  File "/media/luiz/Volume/anaconda3/envs/pytorch1.0.0/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 577, in library_paths
    if (not os.path.exists(_join_cuda_home(lib_dir)) and
  File "/media/luiz/Volume/anaconda3/envs/pytorch1.0.0/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1252, in _join_cuda_home
    raise EnvironmentError('CUDA_HOME environment variable is not set. '
OSError: CUDA_HOME environment variable is not set. Please set it to your CUDA install root.
Traceback (most recent call last):
  File "setup.py", line 16, in <module>
    ], extra_compile_args={'cxx': cxx_args, 'nvcc': nvcc_args})
  File "/media/luiz/Volume/anaconda3/envs/pytorch1.0.0/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 498, in CUDAExtension
    library_dirs += library_paths(cuda=True)
  File "/media/luiz/Volume/anaconda3/envs/pytorch1.0.0/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 577, in library_paths
    if (not os.path.exists(_join_cuda_home(lib_dir)) and
  File "/media/luiz/Volume/anaconda3/envs/pytorch1.0.0/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1252, in _join_cuda_home
    raise EnvironmentError('CUDA_HOME environment variable is not set. '
OSError: CUDA_HOME environment variable is not set. Please set it to your CUDA install root.
Traceback (most recent call last):
  File "setup.py", line 16, in <module>
    ], extra_compile_args={'cxx': cxx_args, 'nvcc': nvcc_args})
  File "/media/luiz/Volume/anaconda3/envs/pytorch1.0.0/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 498, in CUDAExtension
    library_dirs += library_paths(cuda=True)
  File "/media/luiz/Volume/anaconda3/envs/pytorch1.0.0/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 577, in library_paths
    if (not os.path.exists(_join_cuda_home(lib_dir)) and
  File "/media/luiz/Volume/anaconda3/envs/pytorch1.0.0/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1252, in _join_cuda_home
    raise EnvironmentError('CUDA_HOME environment variable is not set. '
OSError: CUDA_HOME environment variable is not set. Please set it to your CUDA install root.
Traceback (most recent call last):
  File "setup.py", line 16, in <module>
    ], extra_compile_args={'cxx': cxx_args, 'nvcc': nvcc_args})
  File "/media/luiz/Volume/anaconda3/envs/pytorch1.0.0/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 498, in CUDAExtension
    library_dirs += library_paths(cuda=True)
  File "/media/luiz/Volume/anaconda3/envs/pytorch1.0.0/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 577, in library_paths
    if (not os.path.exists(_join_cuda_home(lib_dir)) and
  File "/media/luiz/Volume/anaconda3/envs/pytorch1.0.0/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1252, in _join_cuda_home
    raise EnvironmentError('CUDA_HOME environment variable is not set. '
OSError: CUDA_HOME environment variable is not set. Please set it to your CUDA install root.
Traceback (most recent call last):
  File "setup.py", line 16, in <module>
    ], extra_compile_args={'cxx': cxx_args, 'nvcc': nvcc_args})
  File "/media/luiz/Volume/anaconda3/envs/pytorch1.0.0/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 498, in CUDAExtension
    library_dirs += library_paths(cuda=True)
  File "/media/luiz/Volume/anaconda3/envs/pytorch1.0.0/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 577, in library_paths
    if (not os.path.exists(_join_cuda_home(lib_dir)) and
  File "/media/luiz/Volume/anaconda3/envs/pytorch1.0.0/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1252, in _join_cuda_home
    raise EnvironmentError('CUDA_HOME environment variable is not set. '
OSError: CUDA_HOME environment variable is not set. Please set it to your CUDA install root.
Traceback (most recent call last):
  File "setup.py", line 16, in <module>
    ], extra_compile_args={'cxx': cxx_args, 'nvcc': nvcc_args})
  File "/media/luiz/Volume/anaconda3/envs/pytorch1.0.0/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 498, in CUDAExtension
    library_dirs += library_paths(cuda=True)
  File "/media/luiz/Volume/anaconda3/envs/pytorch1.0.0/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 577, in library_paths
    if (not os.path.exists(_join_cuda_home(lib_dir)) and
  File "/media/luiz/Volume/anaconda3/envs/pytorch1.0.0/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1252, in _join_cuda_home
    raise EnvironmentError('CUDA_HOME environment variable is not set. '
OSError: CUDA_HOME environment variable is not set. Please set it to your CUDA install root.
Traceback (most recent call last):
  File "setup.py", line 16, in <module>
    ], extra_compile_args={'cxx': cxx_args, 'nvcc': nvcc_args})
  File "/media/luiz/Volume/anaconda3/envs/pytorch1.0.0/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 498, in CUDAExtension
    library_dirs += library_paths(cuda=True)
  File "/media/luiz/Volume/anaconda3/envs/pytorch1.0.0/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 577, in library_paths
    if (not os.path.exists(_join_cuda_home(lib_dir)) and
  File "/media/luiz/Volume/anaconda3/envs/pytorch1.0.0/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1252, in _join_cuda_home
    raise EnvironmentError('CUDA_HOME environment variable is not set. '
OSError: CUDA_HOME environment variable is not set. Please set it to your CUDA install root.
Traceback (most recent call last):
  File "setup.py", line 16, in <module>
    ], extra_compile_args={'cxx': cxx_args, 'nvcc': nvcc_args})
  File "/media/luiz/Volume/anaconda3/envs/pytorch1.0.0/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 498, in CUDAExtension
    library_dirs += library_paths(cuda=True)
  File "/media/luiz/Volume/anaconda3/envs/pytorch1.0.0/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 577, in library_paths
    if (not os.path.exists(_join_cuda_home(lib_dir)) and
  File "/media/luiz/Volume/anaconda3/envs/pytorch1.0.0/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1252, in _join_cuda_home
    raise EnvironmentError('CUDA_HOME environment variable is not set. '
OSError: CUDA_HOME environment variable is not set. Please set it to your CUDA install root.
iBobbyTS commented 3 years ago

This seems like your CUDA toolkit is not installed correctly, try the following command to check it torch is compatible with CUDA

import torch
torch.Tensor([1.]).cuda()

You should not get warnings or errors for this code. Did you install cuda from nvidia? And is PyTorch from pip or conda, did you choose the correct cuda version?

nanojin commented 3 years ago

I tried this to test the suggested command:

$ python -c "import torch; torch.Tensor([1.]).cuda()"

This is my result :octocat:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/~/.local/lib/python3.8/site-packages/torch/cuda/__init__.py", line 172, in _lazy_init
    torch._C._cuda_init()
RuntimeError: Found no NVIDIA driver on your system. Please check that you have an NVIDIA GPU and installed a driver from http://www.nvidia.com/Download/index.aspx
iBobbyTS commented 3 years ago

This means you don't have an Nvidia GPU or the driver is not installed correctly. You have to have an Nvidia GPU, not AMD or Integrated ones.

iBobbyTS commented 3 years ago

Run nvidia-smi to check the GPU status, you should get something like this

Screen Shot 2020-12-10 at 7 40 35 AM

Make sure there's a CUDA Version at the top right. And find the command to install torch on PyTorch 1.4.0 installation command, select the correct system, and CUDA version.

lgmventura commented 3 years ago

I reinstalled my nVidia drivers entirely (currently using nvidia 450, cuda v.11), created the conda environment called pytorch1.0.0 (conda create -n pytorch1.0.0) and ran what I found in the pytorch's website:

conda install pytorch==1.0.0 torchvision==0.2.1 cuda100 -c pytorch

It now compiled and installed. I will test it later. Thank you so much for the support.

I'll close the issue for now.

courtens commented 3 years ago

running conda install pytorch==1.0.0 torchvision==0.2.1 cuda100 -c pytorch got me:

failed                                                                                                                              

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

Specifications:

  - torchvision==0.2.1 -> python[version='>=2.7,<2.8.0a0|>=3.5,<3.6.0a0|>=3.6,<3.7.0a0|>=3.7,<3.8.0a0']

Your python: python=3.8

Is it a requirement to run the installation as root?

Getting DAIN running on Ubuntu 20.04 turns out to be difficult.

./build.sh returns:

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "setup.py", line 10, in <module>
    setup(
  File "/home/nathaniel/anaconda3/lib/python3.8/site-packages/setuptools/__init__.py", line 153, in setup
    return distutils.core.setup(**attrs)
  File "/home/nathaniel/anaconda3/lib/python3.8/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/home/nathaniel/anaconda3/lib/python3.8/distutils/dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "/home/nathaniel/anaconda3/lib/python3.8/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/home/nathaniel/anaconda3/lib/python3.8/site-packages/setuptools/command/install.py", line 67, in run
    self.do_egg_install()
  File "/home/nathaniel/anaconda3/lib/python3.8/site-packages/setuptools/command/install.py", line 109, in do_egg_install
    self.run_command('bdist_egg')
  File "/home/nathaniel/anaconda3/lib/python3.8/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/home/nathaniel/anaconda3/lib/python3.8/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/home/nathaniel/anaconda3/lib/python3.8/site-packages/setuptools/command/bdist_egg.py", line 164, in run
    cmd = self.call_command('install_lib', warn_dir=0)
  File "/home/nathaniel/anaconda3/lib/python3.8/site-packages/setuptools/command/bdist_egg.py", line 150, in call_command
    self.run_command(cmdname)
  File "/home/nathaniel/anaconda3/lib/python3.8/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/home/nathaniel/anaconda3/lib/python3.8/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/home/nathaniel/anaconda3/lib/python3.8/site-packages/setuptools/command/install_lib.py", line 11, in run
    self.build()
  File "/home/nathaniel/anaconda3/lib/python3.8/distutils/command/install_lib.py", line 107, in build
    self.run_command('build_ext')
  File "/home/nathaniel/anaconda3/lib/python3.8/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/home/nathaniel/anaconda3/lib/python3.8/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/home/nathaniel/anaconda3/lib/python3.8/site-packages/setuptools/command/build_ext.py", line 79, in run
    _build_ext.run(self)
  File "/home/nathaniel/anaconda3/lib/python3.8/site-packages/Cython/Distutils/old_build_ext.py", line 186, in run
    _build_ext.build_ext.run(self)
  File "/home/nathaniel/anaconda3/lib/python3.8/distutils/command/build_ext.py", line 340, in run
    self.build_extensions()
  File "/home/nathaniel/.local/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 670, in build_extensions
    build_ext.build_extensions(self)
  File "/home/nathaniel/anaconda3/lib/python3.8/site-packages/Cython/Distutils/old_build_ext.py", line 195, in build_extensions
    _build_ext.build_ext.build_extensions(self)
  File "/home/nathaniel/anaconda3/lib/python3.8/distutils/command/build_ext.py", line 449, in build_extensions
    self._build_extensions_serial()
  File "/home/nathaniel/anaconda3/lib/python3.8/distutils/command/build_ext.py", line 474, in _build_extensions_serial
    self.build_extension(ext)
  File "/home/nathaniel/anaconda3/lib/python3.8/site-packages/setuptools/command/build_ext.py", line 196, in build_extension
    _build_ext.build_extension(self, ext)
  File "/home/nathaniel/anaconda3/lib/python3.8/distutils/command/build_ext.py", line 528, in build_extension
    objects = self.compiler.compile(sources,
  File "/home/nathaniel/.local/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 491, in unix_wrap_ninja_compile
    _write_ninja_file_and_compile_objects(
  File "/home/nathaniel/.local/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1250, in _write_ninja_file_and_compile_objects
    _run_ninja_build(
  File "/home/nathaniel/.local/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1555, in _run_ninja_build
    raise RuntimeError(message) from e
RuntimeError: Error compiling objects for extension
YouweiLyu commented 3 years ago

@courtens I create a new anaconda environment python=3.6 and run the installation successfully. python 3.8 env may be unsuitable for installing pytorch 1.0.0.

michaelmaverick commented 2 years ago

I managed to make it run on CUDA 8.6. You would need to edit compiler_args.py in order to compile with CUDA 11+ attached is a reference compiler_args file that works with sm86 and CUDA 11 compiler_args.txt