Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Difficulty setting up package #60

Open
abnormally-distributed opened this issue Feb 18, 2022 · 3 comments
Open

Difficulty setting up package #60

abnormally-distributed opened this issue Feb 18, 2022 · 3 comments

Comments

@abnormally-distributed
Copy link

Hi,

First, some basic information about my setup which may be relevant. I am running Pyton 3.8.1, which was installed as part of Anaconda. I am using the Spyder IDE. My operating system is Windows 10.

My issue is that I cannot get the package set up because it says invalid syntax.

Since the pytorch version installed was 1.10.2, I followed the instructions on the github home page:

cd trilinear_cpp
sh setup.sh

Of course changing to the trilinear_cpp directory is fine, but the problem happens with the sh setup.sh line:

sh setup.sh
SyntaxError: invalid syntax

So I just looked at what setup.sh is doing. Since I am using an IDE, I manually added an environment variable for CUDA_HOME and pointed it to the correct location in Windows (C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6).

Next, I tried running the setup.py file, but it says OSError: CUDA_HOME environment variable is not set. Please set it to your CUDA install root. After investigation, I discovered the notebook variant of my GPU does no support cuda processing. So, I simply simplified the setup.py script to the following:

from setuptools import setup
import torch
from torch.utils.cpp_extension import BuildExtension, CUDAExtension, CppExtension


setup(name='trilinear',
   ext_modules=[CppExtension('trilinear', ['src/trilinear.cpp'])],
   cmdclass={'build_ext': BuildExtension})

This results in a sequence of errors (for the record, running the original version of setup.py has the same result):

An exception has occurred, use %tb to see the full traceback.

Traceback (most recent call last):

  File "D:\Anaconda3\lib\distutils\core.py", line 134, in setup
    ok = dist.parse_command_line()

  File "D:\Anaconda3\lib\distutils\dist.py", line 501, in parse_command_line
    raise DistutilsArgError("no commands supplied")

DistutilsArgError: no commands supplied


During handling of the above exception, another exception occurred:

SystemExit: usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
   or: setup.py --help [cmd1 cmd2 ...]
   or: setup.py --help-commands
   or: setup.py cmd --help

error: no commands supplied

Of course, typing %tb just repeats the above, adding no additional information. I know with debugging the first error is the best place to start, but I am not sure what the problem is relating to core.py, or why dist.py thinks commands are missing.

I am new to python so I apologize if the solution is obvious to some, but I am at a loss for how to get this to work. The Image Adaptive 3D Lut seems like it would be very nice to use with processing my photography, so is there a potential solution to these errors?

@zhanghongyong123456
Copy link

Hi,

First, some basic information about my setup which may be relevant. I am running Pyton 3.8.1, which was installed as part of Anaconda. I am using the Spyder IDE. My operating system is Windows 10.

My issue is that I cannot get the package set up because it says invalid syntax.

Since the pytorch version installed was 1.10.2, I followed the instructions on the github home page:

cd trilinear_cpp sh setup.sh

Of course changing to the trilinear_cpp directory is fine, but the problem happens with the sh setup.sh line:

sh setup.sh SyntaxError: invalid syntax

So I just looked at what setup.sh is doing. Since I am using an IDE, I manually added an environment variable for CUDA_HOME and pointed it to the correct location in Windows (C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6).

Next, I tried running the setup.py file, but it says OSError: CUDA_HOME environment variable is not set. Please set it to your CUDA install root. After investigation, I discovered the notebook variant of my GPU does no support cuda processing. So, I simply simplified the setup.py script to the following:

from setuptools import setup
import torch
from torch.utils.cpp_extension import BuildExtension, CUDAExtension, CppExtension


setup(name='trilinear',
   ext_modules=[CppExtension('trilinear', ['src/trilinear.cpp'])],
   cmdclass={'build_ext': BuildExtension})

This results in a sequence of errors (for the record, running the original version of setup.py has the same result):

An exception has occurred, use %tb to see the full traceback.

Traceback (most recent call last):

  File "D:\Anaconda3\lib\distutils\core.py", line 134, in setup
    ok = dist.parse_command_line()

  File "D:\Anaconda3\lib\distutils\dist.py", line 501, in parse_command_line
    raise DistutilsArgError("no commands supplied")

DistutilsArgError: no commands supplied


During handling of the above exception, another exception occurred:

SystemExit: usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
   or: setup.py --help [cmd1 cmd2 ...]
   or: setup.py --help-commands
   or: setup.py cmd --help

error: no commands supplied

Of course, typing %tb just repeats the above, adding no additional information. I know with debugging the first error is the best place to start, but I am not sure what the problem is relating to core.py, or why dist.py thinks commands are missing.

I am new to python so I apologize if the solution is obvious to some, but I am at a loss for how to get this to work. The Image Adaptive 3D Lut seems like it would be very nice to use with processing my photography, so is there a potential solution to these errors?

HIi i want to setup trilinear_cpp ,but error
image
have you setup success ,give me some advices,thanks

@HuiZeng
Copy link
Owner

HuiZeng commented Mar 11, 2022

You may try to use the torch.nn.functional.grid_sample to replace the trilinear function if you have difficulty in building up the cuda implementation.
Please refer to #14 for more information. It may take some time to modify the corresponding codes.

@zhanghongyong123456
Copy link

You may try to use the torch.nn.functional.grid_sample to replace the trilinear function if you have difficulty in building up the cuda implementation. Please refer to #14 for more information. It may take some time to modify the corresponding codes.

I'm not sure if I have the ability to modify the code, I want to install this c++ library on windows, are there any installation requirements, I think I'm missing some key operation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants