最近想要搞 nndet
結果編譯他的 nms.cu 程式 (用來計算預測框效用,因為框很多,用GPU比較快,否則難評估) 時候發生錯誤
D:\env\p310_train_all\lib\site-packages\torch\include\pybind11\cast.h(640): error: too few arguments for template template parameter "Tuple" detected during instantiation of class "pybind11::detail::tuple_caster<Tuple, Ts...> [with Tuple=std::pair, Ts=<T1, T2>]" (738): here D:\env\p310_train_all\lib\site-packages\torch\include\pybind11\cast.h(734): error: too few arguments for template template parameter "Tuple" detected during instantiation of class "pybind11::detail::tuple_caster<Tuple, Ts...> [with Tuple=std::pair, Ts=<T1, T2>]" (738): here 2 errors detected in the compilation of "D:/work/test/nnDetection/nndet/csrc/cuda/nms.cu".
就一直顯示 "error: too few arguments for template template parameter Tuple"
而且經過我的測試
就算把 nms.cu 改成只剩下參數宣告也是會有這個錯誤
意思是說
跟程式碼無關
是編譯的程式有問題
這...
上網找一下
發現這個
https://github.com/facebookresearch/pytorch3d/issues/1024#issuecomment-2606665066
有人說:
"也許可以透過刪除 cast.h 中的行「template <typename T1, typename T2>」和行「class type_caster<std::pair<T1, T2>> : public tuple_caster<std::pair, T1, T2> {};」來解決"
嘗試一下發現真的可以
就是註解掉這邊即可
這問題好像是版本衝突問題
編譯CUDA總是會遇到奇奇怪怪的問題
而且這種問題問AI是找不到答案的...
有時候還是要靠自己啦
目前這種LLM可以說是一種 "人性化資料庫模糊查詢工具"
但真的不能稱作 "智慧"
留言板
歡迎留下建議與分享!希望一起交流!感恩!