ArcticHare105 / SPIN

The offical implementation of "Lightweight Image Super-Resolution with Superpixel Token Interaction" (ICCV2023)
MIT License
81 stars 9 forks source link

Why #5

Open luodi789567890 opened 1 year ago

luodi789567890 commented 1 year ago

/cuda.cu -o cuda.cuda.o /public/home/wzq_majiaojiao/.cache/torch_extensions/py38_cu118/pair_wise_distance/cuda.cu:17:10: fatal error: THC/THC.h: No such file or directory 17 | #include <THC/THC.h> | ^~~ compilation terminated. ninja: build stopped: subcommand failed.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "train.py", line 53, in raise ValueError('not supported model type! or something') ValueError: not supported model type! or something

WadeChiang commented 12 months ago

replace headers in pair_wise_distance_cuda_source.py by following could fix the problem:

#include <stdio.h>
#include <math.h>
#include <cuda.h>
#include <cuda_runtime.h>

#define CUDA_NUM_THREADS 256

#include <torch/extension.h>
#include <torch/types.h>
#include <ATen/core/TensorAccessor.h>
#include <ATen/cuda/CUDAContext.h>
#include <ATen/cuda/Atomic.cuh>
#include <ATen/cuda/DeviceUtils.cuh>
// #include <THC/THC.h>
// #include <THC/THCAtomics.cuh>
// #include <THC/THCDeviceUtils.cuh>
leotuTu commented 8 months ago

Traceback (most recent call last): File "train.py", line 51, in model = utils.import_module('models.{}'.format(args.model)).create_model(args) File "D:\All-model\GAN-Model\Model-train\Four\SPIN-main\SPIN-main\utils.py", line 69, in import_module return importlib.import_module(name) File "D:\anaconda3\envs\spin\lib\importlib__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1006, in _gcd_import File "", line 983, in _find_and_load File "", line 967, in _find_and_load_unlocked File "", line 677, in _load_unlocked File "", line 728, in exec_module File "", line 219, in _call_with_frames_removed File "D:\All-model\GAN-Model\Model-train\Four\SPIN-main\SPIN-main\models\spin.py", line 7, in from .pair_wise_distance import PairwiseDistFunction File "D:\All-model\GAN-Model\Model-train\Four\SPIN-main\SPIN-main\models\pair_wise_distance.py", line 9, in "pair_wise_distance", cpp_sources="", cuda_sources=source File "D:\anaconda3\envs\spin\lib\site-packages\torch\utils\cpp_extension.py", line 1445, in load_inline keep_intermediates=keep_intermediates) File "D:\anaconda3\envs\spin\lib\site-packages\torch\utils\cpp_extension.py", line 1518, in _jit_compile is_standalone=is_standalone) File "D:\anaconda3\envs\spin\lib\site-packages\torch\utils\cpp_extension.py", line 1619, in _write_ninja_file_and_build_library is_standalone=is_standalone) File "D:\anaconda3\envs\spin\lib\site-packages\torch\utils\cpp_extension.py", line 2014, in _write_ninja_file_to_build_library cuda_flags = common_cflags + COMMON_NVCC_FLAGS + _get_cuda_arch_flags() File "D:\anaconda3\envs\spin\lib\site-packages\torch\utils\cpp_extension.py", line 1780, in _get_cuda_arch_flags arch_list[-1] += '+PTX' IndexError: list index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "train.py", line 53, in raise ValueError('not supported model type! or something') ValueError: not supported model type! or something

crazy-stycxj commented 2 weeks ago

include <ATen/cuda/Atomic.cuh>

include <ATen/cuda/DeviceUtils.cuh>

有用!!!!