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

Can't install MONAI with C++ extensions #7464

Open
Nora-Go opened this issue Feb 12, 2024 · 7 comments
Open

Can't install MONAI with C++ extensions #7464

Nora-Go opened this issue Feb 12, 2024 · 7 comments

Comments

@Nora-Go
Copy link

Nora-Go commented Feb 12, 2024

I'm trying to install MONAI with C++ extensions but get errors while installing on Windows and errors while code execution on Linux.

On Windows I tried:
(1)
set BUILD_MONAI=1
$env:BUILD_MONAI=1
git clone https://github.com/Project-MONAI/MONAI
cd MONAI
python setup.py install

Here I get the error:
error.txt

and (2)
set BUILD_MONAI=1
$env:BUILD_MONAI=1
pip install --no-build-isolation git+https://github.com/Project-MONAI/MONAI#egg=monai

I'm using a conda environment with python3.9 and these are the libraries already installed:

alembic               1.13.1
astropy               5.0
astropy-iers-data     0.2024.2.5.0.30.52
bilateralfilter-torch 1.1.0
certifi               2024.2.2
charset-normalizer    3.3.2
colorama              0.4.6
colorlog              6.8.2
contourpy             1.2.0
cycler                0.12.1
einops                0.6.0
fargv                 0.1.8
fil-finder            1.7.2
filelock              3.13.1
fonttools             4.47.2
fsspec                2024.2.0
greenlet              3.0.3
h5py                  3.10.0
huggingface-hub       0.20.3
idna                  3.6
imageio               2.33.1
importlib-resources   6.1.1
joblib                1.3.2
kiwisolver            1.4.5
kornia                0.7.1
lazy_loader           0.3
Mako                  1.3.2
MarkupSafe            2.1.5
matplotlib            3.8.2
networkx              3.2.1
numpy                 1.22.4
opencv-python         4.6.0.66
optuna                3.5.0
packaging             23.2
pillow                10.2.0
pip                   23.3.1
pyerfa                2.0.1.1
pyparsing             3.1.1
python-dateutil       2.8.2
PyWavelets            1.5.0
PyYAML                6.0.1
requests              2.31.0
safetensors           0.4.2
scikit-image          0.19.1
scikit-learn          1.0.2
scipy                 1.7.3
setuptools            68.2.2
SimpleCRF             0.2.1.1
six                   1.16.0
SQLAlchemy            2.0.25
threadpoolctl         3.2.0
tifffile              2024.1.30
timm                  0.9.12
torch                 1.13.0+cu116
torchaudio            0.13.0+cu116
torchmetrics          0.10.3
torchvision           0.14.0+cu116
tormentor             0.1.3
tqdm                  4.66.1
typing_extensions     4.9.0
urllib3               2.2.0
wheel                 0.41.2
yacs                  0.1.8
zipp                  3.17.0

On Linux, I tried:
BUILD_MONAI=1 pip install git+https://github.com/Project-MONAI/MONAI#egg=monai

Here the installation works, however when running my code I get:

Traceback (most recent call last):
  File "/home/atuin/b110dc/b110dc10/Denoised_HookFormer/train.py", line 212, in <module>
    outputs = model(image_batch, image_context)
  File "/home/atuin/b110dc/b110dc10/software/privat/conda/envs/DenoisedHookFormer_env/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1190, in _call_impl
    return forward_call(*input, **kwargs)
  File "/home/atuin/b110dc/b110dc10/Denoised_HookFormer/models/Swin_Transformer_Wrapper.py", line 56, in forward
    x = self.bilateral_filter1(x)
  File "/home/atuin/b110dc/b110dc10/software/privat/conda/envs/DenoisedHookFormer_env/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1190, in _call_impl
    return forward_call(*input, **kwargs)
  File "/home/atuin/b110dc/b110dc10/software/privat/conda/envs/DenoisedHookFormer_env/lib/python3.9/site-packages/monai/networks/layers/filtering.py", line 249, in forward
    prediction = TrainableBilateralFilterFunction.apply(
  File "/home/atuin/b110dc/b110dc10/software/privat/conda/envs/DenoisedHookFormer_env/lib/python3.9/site-packages/monai/networks/layers/filtering.py", line 124, in forward
    output_tensor, output_weights_tensor, do_dx_ki, do_dsig_r, do_dsig_x, do_dsig_y, do_dsig_z = _C.tbf_forward(
  File "/home/atuin/b110dc/b110dc10/software/privat/conda/envs/DenoisedHookFormer_env/lib/python3.9/site-packages/monai/utils/module.py", line 441, in __getattr__
    raise self._exception
  File "/home/atuin/b110dc/b110dc10/software/privat/conda/envs/DenoisedHookFormer_env/lib/python3.9/site-packages/monai/utils/module.py", line 399, in optional_import
    pkg = __import__(module)  # top level module
monai.utils.module.OptionalImportError: import monai._C (/home/atuin/b110dc/b110dc10/software/privat/conda/envs/DenoisedHookFormer_env/lib/python3.9/site-packages/monai/_C.so: undefined symbol: _ZNK3c107SymBool10guard$

I'm happy for any suggestions what I am doing wrong :))

@hubutui
Copy link

hubutui commented Mar 3, 2024

You could check the undefined symbol by c++filt <symbol>. It seems the log output is truncated.

@ytl0623
Copy link
Contributor

ytl0623 commented Mar 28, 2024

Hi @Nora-Go

For the first question, I tried following commands in Windows 11 and the Anaconda environment.

set BUILD_MONAI=1
git clone https://github.com/Project-MONAI/MONAI
cd MONAI
python setup.py install

There are NO errors happened.

...
Using c:\users\user\appdata\roaming\python\python39\site-packages
Finished processing dependencies for monai==1.3.1rc1+2.g2d463a7d

As for the second question, I installed MONAI in Ubuntu 18.04 and the Anaconda environment.

conda create -n monai Python==3.9
conda activate monai
git clone https://github.com/Project-MONAI/MONAI
cd MONAI
set BUILD_MONAI=1
pip install --no-build-isolation git+https://github.com/Project-MONAI/MONAI#egg=monai

There are NO errors that happened, too.

...
Successfully built monai
Installing collected packages: mpmath, typing-extensions, sympy, nvidia-nvtx-cu12, nvidia-nvjitlink-cu12, nvidia-nccl-cu12, nvidia-curand-cu12, nvidia-cufft-cu12, nvidia-cuda-runtime-cu12, nvidia-cuda-nvrtc-cu12, nvidia-cuda-cupti-cu12, nvidia-cublas-cu12, numpy, networkx, MarkupSafe, fsspec, filelock, triton, nvidia-cusparse-cu12, nvidia-cudnn-cu12, jinja2, nvidia-cusolver-cu12, torch, monai
Successfully installed MarkupSafe-2.1.5 filelock-3.13.3 fsspec-2024.3.1 jinja2-3.1.3 monai-1.3.1rc1+2.g2d463a7d mpmath-1.3.0 networkx-3.2.1 numpy-1.26.4 nvidia-cublas-cu12-12.1.3.1 nvidia-cuda-cupti-cu12-12.1.105 nvidia-cuda-nvrtc-cu12-12.1.105 nvidia-cuda-runtime-cu12-12.1.105 nvidia-cudnn-cu12-8.9.2.26 nvidia-cufft-cu12-11.0.2.54 nvidia-curand-cu12-10.3.2.106 nvidia-cusolver-cu12-11.4.5.107 nvidia-cusparse-cu12-12.1.0.106 nvidia-nccl-cu12-2.19.3 nvidia-nvjitlink-cu12-12.4.99 nvidia-nvtx-cu12-12.1.105 sympy-1.12 torch-2.2.2 triton-2.2.0 typing-extensions-4.10.0

@lucasdevries
Copy link

The building works fine like that, but still the error monai.utils.module.OptionalImportError: import monai._C (No module named 'monai._C'). persists. I also tried building though both Option 1 and Option 2 follwing instructions https://docs.monai.io/en/latest/installation.html#option-1-as-a-part-of-your-system-wide-module. For Option 1, without --no-build-isolation I get the error that my cuda version does not align (i use 10.2). For the version with --no-build-installation, I get errors like this:

/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/optim/sgd.h:49:48:   required from here
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:57:59: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, at::Tensor>’ to type ‘torch::OrderedDict<std::basic_string<char>, at::Tensor>&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:69:61: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >’ to type ‘torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >&’
error: command '/opt/amc/devel/cuda-10.2/bin/nvcc' failed with exit code 1

For Option 2, I get the same error. Full output below. Anybody has an idea?

(thin) [lucasdevries@hinton thin_slice_sppinn]$ git clone https://github.com/Project-MONAI/MONAI.git
Cloning into 'MONAI'...
remote: Enumerating objects: 38358, done.
remote: Counting objects: 100% (1612/1612), done.
remote: Compressing objects: 100% (949/949), done.
remote: Total 38358 (delta 903), reused 1240 (delta 663), pack-reused 36746
Receiving objects: 100% (38358/38358), 65.51 MiB | 31.50 MiB/s, done.
Resolving deltas: 100% (30454/30454), done.
(thin) [lucasdevries@hinton thin_slice_sppinn]$ cd MONAI/
(thin) [lucasdevries@hinton MONAI]$ BUILD_MONAI=1 python setup.py develop
/scratch/lucasdevries/thin_slice_sppinn/MONAI/setup.py:20: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  import pkg_resources
setup.py with torch 1.12.1
BUILD_MONAI_CPP=True, BUILD_MONAI_CUDA=True, TORCH_VERSION=11201.
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/setuptools/__init__.py:81: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated.
!!

        ********************************************************************************
        Requirements should be satisfied by a PEP 517 installer.
        If you are using pip, you can try `pip install --use-pep517`.
        ********************************************************************************

!!
  dist.fetch_build_eggs(dist.setup_requires)
running develop
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/setuptools/command/develop.py:40: EasyInstallDeprecationWarning: easy_install command is deprecated.
!!

        ********************************************************************************
        Please avoid running ``setup.py`` and ``easy_install``.
        Instead, use pypa/build, pypa/installer or other
        standards-based tools.

        See https://github.com/pypa/setuptools/issues/917 for details.
        ********************************************************************************

!!
  easy_install.initialize_options(self)
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.
!!

        ********************************************************************************
        Please avoid running ``setup.py`` directly.
        Instead, use pypa/build, pypa/installer or other
        standards-based tools.

        See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
        ********************************************************************************

!!
  self.initialize_options()
running egg_info
creating monai.egg-info
writing monai.egg-info/PKG-INFO
writing dependency_links to monai.egg-info/dependency_links.txt
writing requirements to monai.egg-info/requires.txt
writing top-level names to monai.egg-info/top_level.txt
writing manifest file 'monai.egg-info/SOURCES.txt'
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/utils/cpp_extension.py:411: UserWarning: Attempted to use ninja as the BuildExtension backend but we could not find ninja.. Falling back to using the slow distutils backend.
  warnings.warn(msg.format('we could not find ninja.'))
reading manifest file 'monai.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
adding license file 'LICENSE'
writing manifest file 'monai.egg-info/SOURCES.txt'
running build_ext
building 'monai._C' extension
creating build
creating build/temp.linux-x86_64-cpython-39
creating build/temp.linux-x86_64-cpython-39/scratch
creating build/temp.linux-x86_64-cpython-39/scratch/lucasdevries
creating build/temp.linux-x86_64-cpython-39/scratch/lucasdevries/thin_slice_sppinn
creating build/temp.linux-x86_64-cpython-39/scratch/lucasdevries/thin_slice_sppinn/MONAI
creating build/temp.linux-x86_64-cpython-39/scratch/lucasdevries/thin_slice_sppinn/MONAI/monai
creating build/temp.linux-x86_64-cpython-39/scratch/lucasdevries/thin_slice_sppinn/MONAI/monai/csrc
creating build/temp.linux-x86_64-cpython-39/scratch/lucasdevries/thin_slice_sppinn/MONAI/monai/csrc/filtering
creating build/temp.linux-x86_64-cpython-39/scratch/lucasdevries/thin_slice_sppinn/MONAI/monai/csrc/filtering/bilateral
creating build/temp.linux-x86_64-cpython-39/scratch/lucasdevries/thin_slice_sppinn/MONAI/monai/csrc/filtering/permutohedral
creating build/temp.linux-x86_64-cpython-39/scratch/lucasdevries/thin_slice_sppinn/MONAI/monai/csrc/filtering/trainable_bilateral
creating build/temp.linux-x86_64-cpython-39/scratch/lucasdevries/thin_slice_sppinn/MONAI/monai/csrc/filtering/trainable_joint_bilateral
creating build/temp.linux-x86_64-cpython-39/scratch/lucasdevries/thin_slice_sppinn/MONAI/monai/csrc/lltm
creating build/temp.linux-x86_64-cpython-39/scratch/lucasdevries/thin_slice_sppinn/MONAI/monai/csrc/resample
gcc -pthread -B /scratch/lucasdevries/envs/thin/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /scratch/lucasdevries/envs/thin/include -fPIC -O2 -isystem /scratch/lucasdevries/envs/thin/include -fPIC -DAT_PARALLEL_OPENMP=1 -DMONAI_TORCH_VERSION=11201 -DWITH_CUDA -I/scratch/lucasdevries/thin_slice_sppinn/MONAI/monai/csrc -I/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include -I/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include -I/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/TH -I/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/THC -I/opt/amc/devel/cuda-10.2/include -I/scratch/lucasdevries/envs/thin/include/python3.9 -c /scratch/lucasdevries/thin_slice_sppinn/MONAI/monai/csrc/ext.cpp -o build/temp.linux-x86_64-cpython-39/scratch/lucasdevries/thin_slice_sppinn/MONAI/monai/csrc/ext.o -fopenmp -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE=\"_gcc\" -DPYBIND11_STDLIB=\"_libstdcpp\" -DPYBIND11_BUILD_ABI=\"_cxxabi1011\" -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++14
In file included from /scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/ATen/ATen.h:9:0,
                 from /scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/types.h:3,
                 from /scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader_options.h:4,
                 from /scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/base.h:3,
                 from /scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/stateful.h:3,
                 from /scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader.h:3,
                 from /scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/data.h:3,
                 from /scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/all.h:8,
                 from /scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/extension.h:4,
                 from /scratch/lucasdevries/thin_slice_sppinn/MONAI/monai/csrc/ext.cpp:14:
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/ATen/Context.h:25:67: warning: type attributes ignored after type is already defined [-Wattributes]
 enum class TORCH_API Float32MatmulPrecision {HIGHEST, HIGH, MEDIUM};
                                                                   ^
gcc -pthread -B /scratch/lucasdevries/envs/thin/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /scratch/lucasdevries/envs/thin/include -fPIC -O2 -isystem /scratch/lucasdevries/envs/thin/include -fPIC -DAT_PARALLEL_OPENMP=1 -DMONAI_TORCH_VERSION=11201 -DWITH_CUDA -I/scratch/lucasdevries/thin_slice_sppinn/MONAI/monai/csrc -I/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include -I/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include -I/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/TH -I/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/THC -I/opt/amc/devel/cuda-10.2/include -I/scratch/lucasdevries/envs/thin/include/python3.9 -c /scratch/lucasdevries/thin_slice_sppinn/MONAI/monai/csrc/filtering/bilateral/bilateral.cpp -o build/temp.linux-x86_64-cpython-39/scratch/lucasdevries/thin_slice_sppinn/MONAI/monai/csrc/filtering/bilateral/bilateral.o -fopenmp -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE=\"_gcc\" -DPYBIND11_STDLIB=\"_libstdcpp\" -DPYBIND11_BUILD_ABI=\"_cxxabi1011\" -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++14
In file included from /scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/ATen/ATen.h:9:0,
                 from /scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/types.h:3,
                 from /scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader_options.h:4,
                 from /scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/base.h:3,
                 from /scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/stateful.h:3,
                 from /scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader.h:3,
                 from /scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/data.h:3,
                 from /scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/all.h:8,
                 from /scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/extension.h:4,
                 from /scratch/lucasdevries/thin_slice_sppinn/MONAI/monai/csrc/filtering/bilateral/bilateral.cpp:14:
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/ATen/Context.h:25:67: warning: type attributes ignored after type is already defined [-Wattributes]
 enum class TORCH_API Float32MatmulPrecision {HIGHEST, HIGH, MEDIUM};
                                                                   ^
gcc -pthread -B /scratch/lucasdevries/envs/thin/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /scratch/lucasdevries/envs/thin/include -fPIC -O2 -isystem /scratch/lucasdevries/envs/thin/include -fPIC -DAT_PARALLEL_OPENMP=1 -DMONAI_TORCH_VERSION=11201 -DWITH_CUDA -I/scratch/lucasdevries/thin_slice_sppinn/MONAI/monai/csrc -I/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include -I/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include -I/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/TH -I/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/THC -I/opt/amc/devel/cuda-10.2/include -I/scratch/lucasdevries/envs/thin/include/python3.9 -c /scratch/lucasdevries/thin_slice_sppinn/MONAI/monai/csrc/filtering/bilateral/bilateralfilter_cpu.cpp -o build/temp.linux-x86_64-cpython-39/scratch/lucasdevries/thin_slice_sppinn/MONAI/monai/csrc/filtering/bilateral/bilateralfilter_cpu.o -fopenmp -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE=\"_gcc\" -DPYBIND11_STDLIB=\"_libstdcpp\" -DPYBIND11_BUILD_ABI=\"_cxxabi1011\" -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++14
In file included from /scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/ATen/ATen.h:9:0,
                 from /scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/types.h:3,
                 from /scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader_options.h:4,
                 from /scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/base.h:3,
                 from /scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/stateful.h:3,
                 from /scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader.h:3,
                 from /scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/data.h:3,
                 from /scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/all.h:8,
                 from /scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/extension.h:4,
                 from /scratch/lucasdevries/thin_slice_sppinn/MONAI/monai/csrc/filtering/bilateral/bilateralfilter_cpu.cpp:15:
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/ATen/Context.h:25:67: warning: type attributes ignored after type is already defined [-Wattributes]
 enum class TORCH_API Float32MatmulPrecision {HIGHEST, HIGH, MEDIUM};
                                                                   ^
gcc -pthread -B /scratch/lucasdevries/envs/thin/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /scratch/lucasdevries/envs/thin/include -fPIC -O2 -isystem /scratch/lucasdevries/envs/thin/include -fPIC -DAT_PARALLEL_OPENMP=1 -DMONAI_TORCH_VERSION=11201 -DWITH_CUDA -I/scratch/lucasdevries/thin_slice_sppinn/MONAI/monai/csrc -I/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include -I/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include -I/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/TH -I/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/THC -I/opt/amc/devel/cuda-10.2/include -I/scratch/lucasdevries/envs/thin/include/python3.9 -c /scratch/lucasdevries/thin_slice_sppinn/MONAI/monai/csrc/filtering/bilateral/bilateralfilter_cpu_phl.cpp -o build/temp.linux-x86_64-cpython-39/scratch/lucasdevries/thin_slice_sppinn/MONAI/monai/csrc/filtering/bilateral/bilateralfilter_cpu_phl.o -fopenmp -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE=\"_gcc\" -DPYBIND11_STDLIB=\"_libstdcpp\" -DPYBIND11_BUILD_ABI=\"_cxxabi1011\" -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++14
In file included from /scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/ATen/ATen.h:9:0,
                 from /scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/types.h:3,
                 from /scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader_options.h:4,
                 from /scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/base.h:3,
                 from /scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/stateful.h:3,
                 from /scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader.h:3,
                 from /scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/data.h:3,
                 from /scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/all.h:8,
                 from /scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/extension.h:4,
                 from /scratch/lucasdevries/thin_slice_sppinn/MONAI/monai/csrc/filtering/bilateral/bilateralfilter_cpu_phl.cpp:14:
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/ATen/Context.h:25:67: warning: type attributes ignored after type is already defined [-Wattributes]
 enum class TORCH_API Float32MatmulPrecision {HIGHEST, HIGH, MEDIUM};
                                                                   ^
/opt/amc/devel/cuda-10.2/bin/nvcc -DAT_PARALLEL_OPENMP=1 -DMONAI_TORCH_VERSION=11201 -DWITH_CUDA -I/scratch/lucasdevries/thin_slice_sppinn/MONAI/monai/csrc -I/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include -I/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include -I/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/TH -I/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/THC -I/opt/amc/devel/cuda-10.2/include -I/scratch/lucasdevries/envs/thin/include/python3.9 -c /scratch/lucasdevries/thin_slice_sppinn/MONAI/monai/csrc/filtering/bilateral/bilateralfilter_cuda.cu -o build/temp.linux-x86_64-cpython-39/scratch/lucasdevries/thin_slice_sppinn/MONAI/monai/csrc/filtering/bilateral/bilateralfilter_cuda.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options '-fPIC' -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE=\"_gcc\" -DPYBIND11_STDLIB=\"_libstdcpp\" -DPYBIND11_BUILD_ABI=\"_cxxabi1011\" -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_70,code=compute_70 -gencode=arch=compute_70,code=sm_70 -std=c++14
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/c10/core/SymInt.h(84): warning: integer conversion resulted in a change of sign

/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/ATen/Context.h(25): warning: attribute "__visibility__" does not apply here

/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/c10/core/SymInt.h(84): warning: integer conversion resulted in a change of sign

/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/ATen/Context.h(25): warning: attribute "__visibility__" does not apply here

/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/ATen/Context.h:25:99: warning: type attributes ignored after type is already defined [-Wattributes]
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h: In instantiation of ‘std::shared_ptr<torch::nn::Module> torch::nn::Cloneable<Derived>::clone(const c10::optional<c10::Device>&) const [with Derived = torch::nn::CrossMapLRN2dImpl]’:
/home/lucasdevries/tmp/tmpxft_00012f36_00000000-5_bilateralfilter_cuda.cudafe1.stub.c:448:27:   required from here
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:57:59: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, at::Tensor>’ to type ‘torch::OrderedDict<std::basic_string<char>, at::Tensor>&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:69:61: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >’ to type ‘torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h: In instantiation of ‘std::shared_ptr<torch::nn::Module> torch::nn::Cloneable<Derived>::clone(const c10::optional<c10::Device>&) const [with Derived = torch::nn::EmbeddingBagImpl]’:
/home/lucasdevries/tmp/tmpxft_00012f36_00000000-5_bilateralfilter_cuda.cudafe1.stub.c:448:27:   required from here
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:57:59: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, at::Tensor>’ to type ‘torch::OrderedDict<std::basic_string<char>, at::Tensor>&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:69:61: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >’ to type ‘torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h: In instantiation of ‘std::shared_ptr<torch::nn::Module> torch::nn::Cloneable<Derived>::clone(const c10::optional<c10::Device>&) const [with Derived = torch::nn::EmbeddingImpl]’:
/home/lucasdevries/tmp/tmpxft_00012f36_00000000-5_bilateralfilter_cuda.cudafe1.stub.c:448:27:   required from here
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:57:59: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, at::Tensor>’ to type ‘torch::OrderedDict<std::basic_string<char>, at::Tensor>&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:69:61: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >’ to type ‘torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h: In instantiation of ‘std::shared_ptr<torch::nn::Module> torch::nn::Cloneable<Derived>::clone(const c10::optional<c10::Device>&) const [with Derived = torch::nn::ParameterDictImpl]’:
/home/lucasdevries/tmp/tmpxft_00012f36_00000000-5_bilateralfilter_cuda.cudafe1.stub.c:448:27:   required from here
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:57:59: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, at::Tensor>’ to type ‘torch::OrderedDict<std::basic_string<char>, at::Tensor>&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:69:61: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >’ to type ‘torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h: In instantiation of ‘std::shared_ptr<torch::nn::Module> torch::nn::Cloneable<Derived>::clone(const c10::optional<c10::Device>&) const [with Derived = torch::nn::SequentialImpl]’:
/home/lucasdevries/tmp/tmpxft_00012f36_00000000-5_bilateralfilter_cuda.cudafe1.stub.c:448:27:   required from here
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:57:59: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, at::Tensor>’ to type ‘torch::OrderedDict<std::basic_string<char>, at::Tensor>&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:69:61: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >’ to type ‘torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h: In instantiation of ‘std::shared_ptr<torch::nn::Module> torch::nn::Cloneable<Derived>::clone(const c10::optional<c10::Device>&) const [with Derived = torch::nn::ModuleListImpl]’:
/home/lucasdevries/tmp/tmpxft_00012f36_00000000-5_bilateralfilter_cuda.cudafe1.stub.c:448:27:   required from here
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:57:59: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, at::Tensor>’ to type ‘torch::OrderedDict<std::basic_string<char>, at::Tensor>&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:69:61: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >’ to type ‘torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h: In instantiation of ‘std::shared_ptr<torch::nn::Module> torch::nn::Cloneable<Derived>::clone(const c10::optional<c10::Device>&) const [with Derived = torch::nn::ModuleDictImpl]’:
/home/lucasdevries/tmp/tmpxft_00012f36_00000000-5_bilateralfilter_cuda.cudafe1.stub.c:448:27:   required from here
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:57:59: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, at::Tensor>’ to type ‘torch::OrderedDict<std::basic_string<char>, at::Tensor>&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:69:61: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >’ to type ‘torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h: In instantiation of ‘std::shared_ptr<torch::nn::Module> torch::nn::Cloneable<Derived>::clone(const c10::optional<c10::Device>&) const [with Derived = torch::nn::TransformerDecoderImpl]’:
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/optim/sgd.h:49:48:   required from here
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:57:59: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, at::Tensor>’ to type ‘torch::OrderedDict<std::basic_string<char>, at::Tensor>&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:69:61: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >’ to type ‘torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h: In instantiation of ‘std::shared_ptr<torch::nn::Module> torch::nn::Cloneable<Derived>::clone(const c10::optional<c10::Device>&) const [with Derived = torch::nn::TransformerEncoderImpl]’:
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/optim/sgd.h:49:48:   required from here
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:57:59: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, at::Tensor>’ to type ‘torch::OrderedDict<std::basic_string<char>, at::Tensor>&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:69:61: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >’ to type ‘torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h: In instantiation of ‘std::shared_ptr<torch::nn::Module> torch::nn::Cloneable<Derived>::clone(const c10::optional<c10::Device>&) const [with Derived = torch::nn::TransformerDecoderLayerImpl]’:
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/optim/sgd.h:49:48:   required from here
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:57:59: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, at::Tensor>’ to type ‘torch::OrderedDict<std::basic_string<char>, at::Tensor>&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:69:61: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >’ to type ‘torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h: In instantiation of ‘std::shared_ptr<torch::nn::Module> torch::nn::Cloneable<Derived>::clone(const c10::optional<c10::Device>&) const [with Derived = torch::nn::TransformerEncoderLayerImpl]’:
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/optim/sgd.h:49:48:   required from here
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:57:59: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, at::Tensor>’ to type ‘torch::OrderedDict<std::basic_string<char>, at::Tensor>&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:69:61: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >’ to type ‘torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h: In instantiation of ‘std::shared_ptr<torch::nn::Module> torch::nn::Cloneable<Derived>::clone(const c10::optional<c10::Device>&) const [with Derived = torch::nn::GroupNormImpl]’:
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/optim/sgd.h:49:48:   required from here
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:57:59: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, at::Tensor>’ to type ‘torch::OrderedDict<std::basic_string<char>, at::Tensor>&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:69:61: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >’ to type ‘torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h: In instantiation of ‘std::shared_ptr<torch::nn::Module> torch::nn::Cloneable<Derived>::clone(const c10::optional<c10::Device>&) const [with Derived = torch::nn::LocalResponseNormImpl]’:
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/optim/sgd.h:49:48:   required from here
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:57:59: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, at::Tensor>’ to type ‘torch::OrderedDict<std::basic_string<char>, at::Tensor>&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:69:61: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >’ to type ‘torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h: In instantiation of ‘std::shared_ptr<torch::nn::Module> torch::nn::Cloneable<Derived>::clone(const c10::optional<c10::Device>&) const [with Derived = torch::nn::LayerNormImpl]’:
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/optim/sgd.h:49:48:   required from here
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:57:59: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, at::Tensor>’ to type ‘torch::OrderedDict<std::basic_string<char>, at::Tensor>&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:69:61: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >’ to type ‘torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h: In instantiation of ‘std::shared_ptr<torch::nn::Module> torch::nn::Cloneable<Derived>::clone(const c10::optional<c10::Device>&) const [with Derived = torch::nn::MultiheadAttentionImpl]’:
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/optim/sgd.h:49:48:   required from here
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:57:59: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, at::Tensor>’ to type ‘torch::OrderedDict<std::basic_string<char>, at::Tensor>&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:69:61: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >’ to type ‘torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h: In instantiation of ‘std::shared_ptr<torch::nn::Module> torch::nn::Cloneable<Derived>::clone(const c10::optional<c10::Device>&) const [with Derived = torch::nn::ThresholdImpl]’:
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/optim/sgd.h:49:48:   required from here
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:57:59: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, at::Tensor>’ to type ‘torch::OrderedDict<std::basic_string<char>, at::Tensor>&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:69:61: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >’ to type ‘torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h: In instantiation of ‘std::shared_ptr<torch::nn::Module> torch::nn::Cloneable<Derived>::clone(const c10::optional<c10::Device>&) const [with Derived = torch::nn::LogSoftmaxImpl]’:
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/optim/sgd.h:49:48:   required from here
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:57:59: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, at::Tensor>’ to type ‘torch::OrderedDict<std::basic_string<char>, at::Tensor>&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:69:61: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >’ to type ‘torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h: In instantiation of ‘std::shared_ptr<torch::nn::Module> torch::nn::Cloneable<Derived>::clone(const c10::optional<c10::Device>&) const [with Derived = torch::nn::SoftminImpl]’:
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/optim/sgd.h:49:48:   required from here
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:57:59: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, at::Tensor>’ to type ‘torch::OrderedDict<std::basic_string<char>, at::Tensor>&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:69:61: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >’ to type ‘torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h: In instantiation of ‘std::shared_ptr<torch::nn::Module> torch::nn::Cloneable<Derived>::clone(const c10::optional<c10::Device>&) const [with Derived = torch::nn::SoftmaxImpl]’:
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/optim/sgd.h:49:48:   required from here
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:57:59: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, at::Tensor>’ to type ‘torch::OrderedDict<std::basic_string<char>, at::Tensor>&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:69:61: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >’ to type ‘torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h: In instantiation of ‘std::shared_ptr<torch::nn::Module> torch::nn::Cloneable<Derived>::clone(const c10::optional<c10::Device>&) const [with Derived = torch::nn::GRUCellImpl]’:
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/optim/sgd.h:49:48:   required from here
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:57:59: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, at::Tensor>’ to type ‘torch::OrderedDict<std::basic_string<char>, at::Tensor>&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:69:61: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >’ to type ‘torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h: In instantiation of ‘std::shared_ptr<torch::nn::Module> torch::nn::Cloneable<Derived>::clone(const c10::optional<c10::Device>&) const [with Derived = torch::nn::LSTMCellImpl]’:
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/optim/sgd.h:49:48:   required from here
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:57:59: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, at::Tensor>’ to type ‘torch::OrderedDict<std::basic_string<char>, at::Tensor>&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:69:61: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >’ to type ‘torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h: In instantiation of ‘std::shared_ptr<torch::nn::Module> torch::nn::Cloneable<Derived>::clone(const c10::optional<c10::Device>&) const [with Derived = torch::nn::RNNCellImpl]’:
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/optim/sgd.h:49:48:   required from here
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:57:59: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, at::Tensor>’ to type ‘torch::OrderedDict<std::basic_string<char>, at::Tensor>&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:69:61: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >’ to type ‘torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h: In instantiation of ‘std::shared_ptr<torch::nn::Module> torch::nn::Cloneable<Derived>::clone(const c10::optional<c10::Device>&) const [with Derived = torch::nn::GRUImpl]’:
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/optim/sgd.h:49:48:   required from here
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:57:59: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, at::Tensor>’ to type ‘torch::OrderedDict<std::basic_string<char>, at::Tensor>&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:69:61: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >’ to type ‘torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h: In instantiation of ‘std::shared_ptr<torch::nn::Module> torch::nn::Cloneable<Derived>::clone(const c10::optional<c10::Device>&) const [with Derived = torch::nn::LSTMImpl]’:
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/optim/sgd.h:49:48:   required from here
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:57:59: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, at::Tensor>’ to type ‘torch::OrderedDict<std::basic_string<char>, at::Tensor>&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:69:61: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >’ to type ‘torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h: In instantiation of ‘std::shared_ptr<torch::nn::Module> torch::nn::Cloneable<Derived>::clone(const c10::optional<c10::Device>&) const [with Derived = torch::nn::RNNImpl]’:
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/optim/sgd.h:49:48:   required from here
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:57:59: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, at::Tensor>’ to type ‘torch::OrderedDict<std::basic_string<char>, at::Tensor>&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:69:61: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >’ to type ‘torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h: In instantiation of ‘std::shared_ptr<torch::nn::Module> torch::nn::Cloneable<Derived>::clone(const c10::optional<c10::Device>&) const [with Derived = torch::nn::FractionalMaxPool3dImpl]’:
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/optim/sgd.h:49:48:   required from here
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:57:59: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, at::Tensor>’ to type ‘torch::OrderedDict<std::basic_string<char>, at::Tensor>&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:69:61: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >’ to type ‘torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h: In instantiation of ‘std::shared_ptr<torch::nn::Module> torch::nn::Cloneable<Derived>::clone(const c10::optional<c10::Device>&) const [with Derived = torch::nn::FractionalMaxPool2dImpl]’:
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/optim/sgd.h:49:48:   required from here
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:57:59: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, at::Tensor>’ to type ‘torch::OrderedDict<std::basic_string<char>, at::Tensor>&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:69:61: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >’ to type ‘torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h: In instantiation of ‘std::shared_ptr<torch::nn::Module> torch::nn::Cloneable<Derived>::clone(const c10::optional<c10::Device>&) const [with Derived = torch::nn::ZeroPad2dImpl]’:
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/optim/sgd.h:49:48:   required from here
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:57:59: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, at::Tensor>’ to type ‘torch::OrderedDict<std::basic_string<char>, at::Tensor>&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:69:61: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >’ to type ‘torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h: In instantiation of ‘std::shared_ptr<torch::nn::Module> torch::nn::Cloneable<Derived>::clone(const c10::optional<c10::Device>&) const [with Derived = torch::nn::UnfoldImpl]’:
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/optim/sgd.h:49:48:   required from here
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:57:59: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, at::Tensor>’ to type ‘torch::OrderedDict<std::basic_string<char>, at::Tensor>&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:69:61: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >’ to type ‘torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h: In instantiation of ‘std::shared_ptr<torch::nn::Module> torch::nn::Cloneable<Derived>::clone(const c10::optional<c10::Device>&) const [with Derived = torch::nn::FoldImpl]’:
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/optim/sgd.h:49:48:   required from here
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:57:59: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, at::Tensor>’ to type ‘torch::OrderedDict<std::basic_string<char>, at::Tensor>&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:69:61: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >’ to type ‘torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h: In instantiation of ‘std::shared_ptr<torch::nn::Module> torch::nn::Cloneable<Derived>::clone(const c10::optional<c10::Device>&) const [with Derived = torch::nn::ConvTranspose3dImpl]’:
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/optim/sgd.h:49:48:   required from here
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:57:59: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, at::Tensor>’ to type ‘torch::OrderedDict<std::basic_string<char>, at::Tensor>&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:69:61: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >’ to type ‘torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h: In instantiation of ‘std::shared_ptr<torch::nn::Module> torch::nn::Cloneable<Derived>::clone(const c10::optional<c10::Device>&) const [with Derived = torch::nn::ConvTranspose2dImpl]’:
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/optim/sgd.h:49:48:   required from here
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:57:59: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, at::Tensor>’ to type ‘torch::OrderedDict<std::basic_string<char>, at::Tensor>&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:69:61: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >’ to type ‘torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h: In instantiation of ‘std::shared_ptr<torch::nn::Module> torch::nn::Cloneable<Derived>::clone(const c10::optional<c10::Device>&) const [with Derived = torch::nn::ConvTranspose1dImpl]’:
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/optim/sgd.h:49:48:   required from here
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:57:59: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, at::Tensor>’ to type ‘torch::OrderedDict<std::basic_string<char>, at::Tensor>&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:69:61: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >’ to type ‘torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h: In instantiation of ‘std::shared_ptr<torch::nn::Module> torch::nn::Cloneable<Derived>::clone(const c10::optional<c10::Device>&) const [with Derived = torch::nn::Conv3dImpl]’:
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/optim/sgd.h:49:48:   required from here
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:57:59: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, at::Tensor>’ to type ‘torch::OrderedDict<std::basic_string<char>, at::Tensor>&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:69:61: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >’ to type ‘torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h: In instantiation of ‘std::shared_ptr<torch::nn::Module> torch::nn::Cloneable<Derived>::clone(const c10::optional<c10::Device>&) const [with Derived = torch::nn::Conv2dImpl]’:
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/optim/sgd.h:49:48:   required from here
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:57:59: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, at::Tensor>’ to type ‘torch::OrderedDict<std::basic_string<char>, at::Tensor>&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:69:61: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >’ to type ‘torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h: In instantiation of ‘std::shared_ptr<torch::nn::Module> torch::nn::Cloneable<Derived>::clone(const c10::optional<c10::Device>&) const [with Derived = torch::nn::Conv1dImpl]’:
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/optim/sgd.h:49:48:   required from here
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:57:59: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, at::Tensor>’ to type ‘torch::OrderedDict<std::basic_string<char>, at::Tensor>&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:69:61: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >’ to type ‘torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h: In instantiation of ‘std::shared_ptr<torch::nn::Module> torch::nn::Cloneable<Derived>::clone(const c10::optional<c10::Device>&) const [with Derived = torch::nn::AdaptiveLogSoftmaxWithLossImpl]’:
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/optim/sgd.h:49:48:   required from here
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:57:59: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, at::Tensor>’ to type ‘torch::OrderedDict<std::basic_string<char>, at::Tensor>&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:69:61: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >’ to type ‘torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h: In instantiation of ‘std::shared_ptr<torch::nn::Module> torch::nn::Cloneable<Derived>::clone(const c10::optional<c10::Device>&) const [with Derived = torch::nn::BilinearImpl]’:
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/optim/sgd.h:49:48:   required from here
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:57:59: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, at::Tensor>’ to type ‘torch::OrderedDict<std::basic_string<char>, at::Tensor>&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:69:61: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >’ to type ‘torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h: In instantiation of ‘std::shared_ptr<torch::nn::Module> torch::nn::Cloneable<Derived>::clone(const c10::optional<c10::Device>&) const [with Derived = torch::nn::UnflattenImpl]’:
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/optim/sgd.h:49:48:   required from here
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:57:59: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, at::Tensor>’ to type ‘torch::OrderedDict<std::basic_string<char>, at::Tensor>&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:69:61: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >’ to type ‘torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h: In instantiation of ‘std::shared_ptr<torch::nn::Module> torch::nn::Cloneable<Derived>::clone(const c10::optional<c10::Device>&) const [with Derived = torch::nn::LinearImpl]’:
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/optim/sgd.h:49:48:   required from here
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:57:59: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, at::Tensor>’ to type ‘torch::OrderedDict<std::basic_string<char>, at::Tensor>&’
/scratch/lucasdevries/envs/thin/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:69:61: error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >’ to type ‘torch::OrderedDict<std::basic_string<char>, std::shared_ptr<torch::nn::Module> >&’
error: command '/opt/amc/devel/cuda-10.2/bin/nvcc' failed with exit code 1
(thin) [lucasdevries@hinton MONAI]$ 

@hubutui
Copy link

hubutui commented Apr 9, 2024

You could check this PKGBUILD for building python-monai from the source. It might help. Note the deps are from the AUR or archlinux with latest release.

@lucasdevries
Copy link

@hubutui Could you elaborate? I am not sure how that would help? I use either Windows or (Red Hat) Linux.

@hubutui
Copy link

hubutui commented Apr 10, 2024

I think the key is you need to make sure the gcc/g++ compiler, cuda, pytorch are compatible. In ArchLinux, all deps are the latest release.
Maybe you could try cuda 12.1.

@lucasdevries
Copy link

Thanks. I build a docker image with cuda 12.1 and that seems to solve the problem. Now running into the same issue as #7457 .

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

4 participants