PeterL1n / RobustVideoMatting

Robust Video Matting in PyTorch, TensorFlow, TensorFlow.js, ONNX, CoreML!
https://peterl1n.github.io/RobustVideoMatting/
GNU General Public License v3.0
8.32k stars 1.11k forks source link

Running Inference on 4090 gives this error #221

Open felixgeen opened 1 year ago

felixgeen commented 1 year ago
(RVM) C:\Users\7950X\RobustVideoMatting>python inference.py --variant mobilenetv3 --checkpoint checkpoint/rvm_mobilenetv3.pth --device cuda --input-source input/16by9.mp4 --output-type video --output-composition output/com.mp4 --output-alpha output/alp.mp4 --output-foreground output/for.mp4 --output-video-mbps 15 --seq-chunk 1
  0%|▏                                                                                     | 1/503 [00:02<17:01,  2.03s/it]Traceback (most recent call last):
  File "inference.py", line 204, in <module>
    progress=not args.disable_progress
  File "inference.py", line 169, in convert
    convert_video(self.model, device=self.device, dtype=torch.float32, *args, **kwargs)
  File "inference.py", line 127, in convert_video
    fgr, pha, *rec = model(src, *rec, downsample_ratio)
  File "C:\Users\7950X\anaconda3\envs\RVM\lib\site-packages\torch\nn\modules\module.py", line 889, in _call_impl
    result = self.forward(*input, **kwargs)
RuntimeError: nvrtc: error: invalid value for --gpu-architecture (-arch)

nvrtc compilation failed:

#define NAN __int_as_float(0x7fffffff)
#define POS_INFINITY __int_as_float(0x7f800000)
#define NEG_INFINITY __int_as_float(0xff800000)

template<typename T>
__device__ T maximum(T a, T b) {
  return isnan(a) ? a : (a > b ? a : b);
}

template<typename T>
__device__ T minimum(T a, T b) {
  return isnan(a) ? a : (a < b ? a : b);
}

extern "C" __global__
void fused_sigmoid_mul(float* t0, float* t1, float* aten_mul) {
{
  float v = __ldg(t0 + (576 * (((512 * blockIdx.x + threadIdx.x) / 576) % 128) + 32 * (((512 * blockIdx.x + threadIdx.x) / 32) % 18)) + (512 * blockIdx.x + threadIdx.x) % 32);
  float v_1 = __ldg(t1 + ((512 * blockIdx.x + threadIdx.x) / 576) % 128);
  aten_mul[((((512 * blockIdx.x + threadIdx.x) / 73728) * 73728 + 576 * (((512 * blockIdx.x + threadIdx.x) / 576) % 128)) + 32 * (((512 * blockIdx.x + threadIdx.x) / 32) % 18)) + (512 * blockIdx.x + threadIdx.x) % 32] = v * (1.f / (1.f + (expf(0.f - v_1))));
}
}

  0%|          | 1/503 [00:02<21:32,  2.57s/it]

(RVM) C:\Users\7950X\RobustVideoMatting>
szkruk commented 1 year ago

Any progress?

yuqilol commented 5 months ago

没gpu吧