【已解決】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(...)
就可以了。
相關文章
- 解決service iptables save出錯please try to use systemctl
- Android requires compiler compliance level 5.0 or 6.0. Found '1.7' instead. Please use Android ToolAndroidUICompile
- DEPRECATED: Use of this script to execute hdfs command is deprecated.
- please help!webshere use hibernate err,urgentWeb
- ImportError: No module named ‘torch‘ 解決方法ImportError
- ImportError: No module named setuptools 解決方法ImportError
- MySQL5.6之use_index_extensions優化MySqlIndex優化
- ImportError: cannot import name ‘imresize‘解決辦法ImportError
- ImportError: No module named thrift.Thrift問題解決ImportError
- ImportError: Start directory is not importable: './test_case'怎麼解決?ImportError
- error: use of deleted function ‘YYSTYPE::YYSTYPE()’[解決]ErrordeleteFunction
- Warning: $HADOOP_HOME is deprecated. hadoop解決方法補充版Hadoop
- 解決 ImportError: cannot import name 'imread' from 'scipy.misc'ImportError
- ImportError: Start directory is not importable: './test_case'怎麼解決?已附上詳細程式碼和專案結果說明。ImportError
- cpp異常詳解
- 錯誤解決:Attempting to use uninitialized value VariableZed
- Nginx下出現 see security.limit_extensions錯誤的解決方法NginxMIT
- SnapKit 原始碼解讀(一):ExtensionsAPK原始碼
- Unable to save settings: Failed to save settings. Please restart PyCharm解決AIRESTPyCharm
- VMWARE WORKSATTION 中 “the device is curreently in use” 解決一例dev
- 解決"/dev/sdX is apparently in use by the systemwill not make a filesystem here"devAPP
- 解決ImportError: libmysqlclient_r.so.16: cannot open shared object fileImportErrorIBMMySqlclientObject
- 【已解決】Error filter ListenerStartErrorFilter
- Unity Android il2cpp的完美熱更解決方案UnityAndroid
- lombok 註解無效 已解決Lombok
- cpp
- 解決Error Initialization failed for ‘https://start.spring.io‘Please check URL, nErrorAIHTTPSpring
- pycharm環境,命令列執行提示:ImportError: No module named xxx 解決方法PyCharm命令列ImportError
- wget 命令提示 “use ‘--no-check-certificate’” 臨時解決方法wget
- 解決 eclipse出現 Address already in use: bindEclipse
- Address already in use: JVM_Bind:80 解決方案JVM
- log4j:WARN Please initialize the log4j system properly解決辦法
- linux inode已滿解決方法Linux
- 已經解決java.lang.OutOfMemoryErrorJavaError
- Workspace in use or cannot be created, choose a different one.--錯誤解決辦法
- 解決svnserve: Can't bind server socket: Address already in useServer
- ORA-01552: cannot use system rollback錯誤解決方法
- Vue.use(plugin)詳解VuePlugin