justanhduc / graphx-conv

Official implementation of GraphX-Convolution
https://justanhduc.github.io/2019/09/29/GraphX-Convolution.html
MIT License
62 stars 17 forks source link

error: option --cuda-ext not recognized when install the neuralnet-pytorch #8

Closed brian220 closed 3 years ago

brian220 commented 3 years ago

Hi @justanhduc, Thanks for your nice implementation, I meet an error when using the command in readme pip install "neuralnet-pytorch[gin] @ git+git://github.com/justanhduc/neuralnet-pytorch.git@6bda19fdc57f176cb82f58d287602f4ccf4cfc23" --global-option="--cuda-ext" it said option --cuda-ext not recognized

  cmdoptions.check_install_build_global(options)
Collecting neuralnet-pytorch[gin]@ git+git://github.com/justanhduc/neuralnet-pytorch.git@6bda19fdc57f176cb82f58d287602f4ccf4cfc23
  Cloning git://github.com/justanhduc/neuralnet-pytorch.git (to revision 6bda19fdc57f176cb82f58d287602f4ccf4cfc23) to /tmp/pip-install-36_85ofg/neuralnet-pytorch_9d5d3799930c4877a52d1ff128748ee3
Requirement already satisfied: matplotlib in ./graphx_venv/lib/python3.6/site-packages (from neuralnet-pytorch[gin]@ git+git://github.com/justanhduc/neuralnet-pytorch.git@6bda19fdc57f176cb82f58d287602f4ccf4cfc23) (3.0.3)
Requirement already satisfied: numpy in ./graphx_venv/lib/python3.6/site-packages (from neuralnet-pytorch[gin]@ git+git://github.com/justanhduc/neuralnet-pytorch.git@6bda19fdc57f176cb82f58d287602f4ccf4cfc23) (1.19.4)
Requirement already satisfied: gin-config in ./graphx_venv/lib/python3.6/site-packages (from neuralnet-pytorch[gin]@ git+git://github.com/justanhduc/neuralnet-pytorch.git@6bda19fdc57f176cb82f58d287602f4ccf4cfc23) (0.4.0)
Collecting future
  Using cached future-0.18.2.tar.gz (829 kB)
Collecting imageio
  Using cached imageio-2.9.0.tar.gz (3.3 MB)
Requirement already satisfied: pillow in ./graphx_venv/lib/python3.6/site-packages (from imageio->neuralnet-pytorch[gin]@ git+git://github.com/justanhduc/neuralnet-pytorch.git@6bda19fdc57f176cb82f58d287602f4ccf4cfc23) (8.0.1)
Requirement already satisfied: cycler>=0.10 in ./graphx_venv/lib/python3.6/site-packages (from matplotlib->neuralnet-pytorch[gin]@ git+git://github.com/justanhduc/neuralnet-pytorch.git@6bda19fdc57f176cb82f58d287602f4ccf4cfc23) (0.10.0)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in ./graphx_venv/lib/python3.6/site-packages (from matplotlib->neuralnet-pytorch[gin]@ git+git://github.com/justanhduc/neuralnet-pytorch.git@6bda19fdc57f176cb82f58d287602f4ccf4cfc23) (2.4.7)
Requirement already satisfied: python-dateutil>=2.1 in ./graphx_venv/lib/python3.6/site-packages (from matplotlib->neuralnet-pytorch[gin]@ git+git://github.com/justanhduc/neuralnet-pytorch.git@6bda19fdc57f176cb82f58d287602f4ccf4cfc23) (2.8.1)
Requirement already satisfied: kiwisolver>=1.0.1 in ./graphx_venv/lib/python3.6/site-packages (from matplotlib->neuralnet-pytorch[gin]@ git+git://github.com/justanhduc/neuralnet-pytorch.git@6bda19fdc57f176cb82f58d287602f4ccf4cfc23) (1.3.1)
Requirement already satisfied: six in ./graphx_venv/lib/python3.6/site-packages (from cycler>=0.10->matplotlib->neuralnet-pytorch[gin]@ git+git://github.com/justanhduc/neuralnet-pytorch.git@6bda19fdc57f176cb82f58d287602f4ccf4cfc23) (1.15.0)
Collecting scipy
  Using cached scipy-1.5.4.tar.gz (25.2 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Skipping wheel build for neuralnet-pytorch, due to binaries being disabled for it.
Skipping wheel build for future, due to binaries being disabled for it.
Skipping wheel build for imageio, due to binaries being disabled for it.
Building wheels for collected packages: scipy
  Building wheel for scipy (PEP 517) ... done
  Created wheel for scipy: filename=scipy-1.5.4-cp36-cp36m-linux_x86_64.whl size=44709882 sha256=68098fc04ec5590b60a477e6f770f6d06f46774dbfb1f736bae4303751645a26
  Stored in directory: /home/itri/.cache/pip/wheels/65/53/49/bf06728084167eb3898600fff91948ebd35e1c470a3cd06608
Successfully built scipy
Installing collected packages: scipy, imageio, future, neuralnet-pytorch
    Running setup.py install for imageio ... error
    ERROR: Command errored out with exit status 1:
     command: /media/itri/Files_2TB/chaoyu/pointcloud3d/graphx-conv/graphx_venv/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-36_85ofg/imageio_97c7989ce77b41e39080fb6f005fc69a/setup.py'"'"'; __file__='"'"'/tmp/pip-install-36_85ofg/imageio_97c7989ce77b41e39080fb6f005fc69a/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' --cuda-ext install --record /tmp/pip-record-clyjvm6q/install-record.txt --single-version-externally-managed --compile --install-headers /media/itri/Files_2TB/chaoyu/pointcloud3d/graphx-conv/graphx_venv/include/site/python3.6/imageio
         cwd: /tmp/pip-install-36_85ofg/imageio_97c7989ce77b41e39080fb6f005fc69a/
    Complete output (6 lines):
    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: option --cuda-ext not recognized
    ----------------------------------------
ERROR: Command errored out with exit status 1: /media/itri/Files_2TB/chaoyu/pointcloud3d/graphx-conv/graphx_venv/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-36_85ofg/imageio_97c7989ce77b41e39080fb6f005fc69a/setup.py'"'"'; __file__='"'"'/tmp/pip-install-36_85ofg/imageio_97c7989ce77b41e39080fb6f005fc69a/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' --cuda-ext install --record /tmp/pip-record-clyjvm6q/install-record.txt --single-version-externally-managed --compile --install-headers /media/itri/Files_2TB/chaoyu/pointcloud3d/graphx-conv/graphx_venv/include/site/python3.6/imageio Check the logs for full command output.

Following is my environment

--------------- -------
cycler          0.10.0
gin-config      0.4.0
kiwisolver      1.3.1
matplotlib      3.0.3
numpy           1.19.4
Pillow          8.0.1
pip             20.3.3
protobuf        3.14.0
pyparsing       2.4.7
python-dateutil 2.8.1
scipy           1.5.4
setuptools      50.3.2
six             1.15.0
tensorboardX    1.2
torch           1.2.0
torchvision     0.4.0
wheel           0.35.1

I can't find out the problem, thanks.

justanhduc commented 3 years ago

Hi. In that case could you please just try cloning the repository, checkout the revision 6bda19fdc57f176cb82f58d287602f4ccf4cfc23 and install using python setup.py install --cuda-ext?

brian220 commented 3 years ago

Hi, it works, I can run the code with neuralnet-pytorch now.

Thank you very much!

brian220 commented 3 years ago

Hi, I meet another error when running the training code. AttributeError: module 'neuralnet_pytorch' has no attribute 'ext'

Training...
Traceback (most recent call last):
  File "train.py", line 92, in <module>
    train_valid()
  File "/media/itri/Files_2TB/chaoyu/pointcloud3d/graphx-conv/graphx_venv/lib/python3.6/site-packages/gin/config.py", line 1069, in gin_wrapper
    utils.augment_exception_message_and_reraise(e, err_str)
  File "/media/itri/Files_2TB/chaoyu/pointcloud3d/graphx-conv/graphx_venv/lib/python3.6/site-packages/gin/utils.py", line 41, in augment_exception_message_and_reraise
    raise proxy.with_traceback(exception.__traceback__) from None
  File "/media/itri/Files_2TB/chaoyu/pointcloud3d/graphx-conv/graphx_venv/lib/python3.6/site-packages/gin/config.py", line 1046, in gin_wrapper
    return fn(*new_args, **new_kwargs)
  File "train.py", line 86, in train_valid
    valid_freq=val_freq, reduce='mean')
  File "/media/itri/Files_2TB/chaoyu/pointcloud3d/graphx-conv/graphx_venv/lib/python3.6/site-packages/neuralnet_pytorch-1.0.0+fancy.144.g6bda19f-py3.6-linux-x86_64.egg/neuralnet_pytorch/monitor.py", line 843, in run_training
    loss = net.train_procedure(batch, *args, **kwargs)
  File "/media/itri/Files_2TB/chaoyu/pointcloud3d/graphx-conv/src/networks.py", line 306, in train_procedure
    loss = self.get_loss(batch, reduce, normalized)
  File "/media/itri/Files_2TB/chaoyu/pointcloud3d/graphx-conv/src/networks.py", line 302, in get_loss
    gt_pc) if isinstance(gt_pc, (list, tuple)) else normalized_chamfer_loss(pred_pc, gt_pc, reduce=reduce, normalized=normalized)
  File "/media/itri/Files_2TB/chaoyu/pointcloud3d/graphx-conv/src/networks.py", line 301, in <listcomp>
    loss = sum([normalized_chamfer_loss(pred[None], gt[None], reduce=reduce, normalized=normalized) for pred, gt in zip(pred_pc, gt_pc)]) / len(
  File "/media/itri/Files_2TB/chaoyu/pointcloud3d/graphx-conv/src/networks.py", line 20, in normalized_chamfer_loss
    loss = nnt.chamfer_loss(pred, gt, reduce=reduce)
  File "/media/itri/Files_2TB/chaoyu/pointcloud3d/graphx-conv/graphx_venv/lib/python3.6/site-packages/neuralnet_pytorch-1.0.0+fancy.144.g6bda19f-py3.6-linux-x86_64.egg/neuralnet_pytorch/metrics.py", line 117, in chamfer_loss
    from .extensions import chamfer_distance
  File "/media/itri/Files_2TB/chaoyu/pointcloud3d/graphx-conv/graphx_venv/lib/python3.6/site-packages/neuralnet_pytorch-1.0.0+fancy.144.g6bda19f-py3.6-linux-x86_64.egg/neuralnet_pytorch/extensions/__init__.py", line 1, in <module>
    from .dist_chamfer import chamfer_distance
  File "/media/itri/Files_2TB/chaoyu/pointcloud3d/graphx-conv/graphx_venv/lib/python3.6/site-packages/neuralnet_pytorch-1.0.0+fancy.144.g6bda19f-py3.6-linux-x86_64.egg/neuralnet_pytorch/extensions/dist_chamfer.py", line 3, in <module>
    import neuralnet_pytorch.ext as ext
AttributeError: module 'neuralnet_pytorch' has no attribute 'ext'
  In call to configurable 'GraphX' (<function train_valid at 0x7efeddcfcbf8>)
2020-12-30 15:12:02,628 [Thread-1    ] [INFO ]  Elapsed time 0.16mins run2  Epoch 1 Iteration 0/32514 (0.00%)

My environment setting

Package           Version
----------------- ------------------------
cycler            0.10.0
future            0.18.2
gin-config        0.4.0
imageio           2.9.0
kiwisolver        1.3.1
matplotlib        3.0.3
neuralnet-pytorch 1.0.0+fancy.144.g6bda19f
numpy             1.19.4
Pillow            8.0.1
pip               20.3.3
protobuf          3.14.0
pyparsing         2.4.7
python-dateutil   2.8.1
scipy             1.5.4
setuptools        50.3.2
six               1.15.0
tensorboardX      2.1
torch             1.2.0
torchvision       0.4.0
wheel             0.35.1

I think I have successfully installed the right version of neuralnet-pytorch (revision 6bda19fdc57f176cb82f58d287602f4ccf4cfc23) But something went wrong, could you give me some advice about this?

Thanks.

justanhduc commented 3 years ago

Hello. It means you didn't successfully install the package. Could you replace line 28 in setup.py by ext_root = os.path.join(os.getcwd(), 'neuralnet_pytorch/extensions') and run the setup again? This bug was fixed in 1c78fe3.

zhangyahu1 commented 3 years ago

Hi, how do you modify the version as '6bda19fdc57f176cb82f58d287602f4ccf4cfc23' ?

lixyxd commented 3 years ago

Hi, how do you modify the version as '6bda19fdc57f176cb82f58d287602f4ccf4cfc23' ?

I have same question, how did you deal with it?