【已解決】ImportError: torch.utils.ffi is deprecated. Please use cpp extensions instead.
本文記錄了博主遇到問題“ImportError: torch.utils.ffi is deprecated. Please use cpp extensions instead.”
的解決方案。更新於2019.03.12。
背景: 博主需要安裝一個程式,該程式用到了PyTorch中的一個包(torch.utils.ffi
),但是博主安裝的PyTorch版本是1.0.1,也就因此導致了上面的錯誤。
原因: 在PyTorch 1.0.1中,torch.utils.ffi
被棄用了,需要用其他包來替代。
解決辦法: 對於博主遇到的問題,將原語句
from torch.utils.ffi import create_extension
修改成
from torch.utils.cpp_extension import BuildExtension
再將檔案下面的呼叫
ffi = create_extension(...)
改成
ffi = BuildExtension(...)
就可以了。
相關文章
- antD——Warning: `callback` is deprecated. Please return a promise instead.Promise
- 解決service iptables save出錯please try to use systemctl
- ImportError: No module named ‘torch‘ 解決方法ImportError
- ImportError: cannot import name ‘imresize‘解決辦法ImportError
- error: use of deleted function ‘YYSTYPE::YYSTYPE()’[解決]ErrordeleteFunction
- 解決 ImportError: cannot import name 'imread' from 'scipy.misc'ImportError
- ImportError: Start directory is not importable: './test_case'怎麼解決?ImportError
- 錯誤解決:Attempting to use uninitialized value VariableZed
- 解決 eclipse出現 Address already in use: bindEclipse
- Unable to save settings: Failed to save settings. Please restart PyCharm解決AIRESTPyCharm
- ImportError: Start directory is not importable: './test_case'怎麼解決?已附上詳細程式碼和專案結果說明。ImportError
- Nginx下出現 see security.limit_extensions錯誤的解決方法NginxMIT
- SnapKit 原始碼解讀(一):ExtensionsAPK原始碼
- 解決nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)NginxAI
- 解決Error Initialization failed for ‘https://start.spring.io‘Please check URL, nErrorAIHTTPSpring
- Unity Android il2cpp的完美熱更解決方案UnityAndroid
- pycharm環境,命令列執行提示:ImportError: No module named xxx 解決方法PyCharm命令列ImportError
- wget 命令提示 “use ‘--no-check-certificate’” 臨時解決方法wget
- 【已解決】Error filter ListenerStartErrorFilter
- lombok 註解無效 已解決Lombok
- linux inode已滿解決方法Linux
- Vue.use(plugin)詳解VuePlugin
- 解決PHP 7.4安裝xdebug出現configure: error: rtnetlink.h is required, please...PHPErrorUI
- 關於python安裝dlib報錯“ ImportError: DLL load failed”的解決方法之一PythonImportErrorAI
- cpp
- onMounted is called when there is no active component 已解決
- 【已解決】挖礦病毒 logrotate 185.196.8.123logrotate
- A Security Analysis Of Browser Extensions
- Android gradle問題解決: This app has been built with an incorrect configuration. Please configure your b...AndroidGradleAPPUI
- win10執行gta5提示unrecoverable fault - please restart the game怎麼解決Win10RESTGAM
- Please do not register multiple Pages in undefined.js 小程式報錯的幾種解決方案UndefinedJS
- 【Android】報錯 Please ensure Hyper-V is disabled in Windows Features, or refer to the Intel HAXM 的解決方案AndroidWindowsIntel
- 關於Vue.use()詳解Vue
- inplace-abn 報錯解決: ImportError: libcudart.so.9.0: cannot open shared object file: No such file or dirImportErrorDartObject
- PHP 7.3 "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? 解決方法PHPUI
- 簡易的解決方式linker command failed with exit code 1 (use -v to see invocation)AI
- [cpp]C++中的解構函式C++函式
- 完美解決SqlServer2012啟動報錯(cannot find one or more components.Please reinstall the application。)SQLServerAPP