最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

解決Ubuntu18中的pycharm不能調(diào)用tensorflow-gpu的問題

 更新時間:2020年09月17日 10:41:47   作者:AnswerThe  
這篇文章主要介紹了解決Ubuntu18中的pycharm不能調(diào)用tensorflow-gpu的問題,文中通過示例代碼介紹的非常詳細,對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧

問題描述:我通過控制臺使用tensorflow-gpu沒問題,但是通過pycharm使用卻不可以,如下所示:

通過控制臺:

answer@answer-desktop:/$ python
Python 3.7.0 (default, Jun 28 2018, 13:15:42) 
[GCC 7.2.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
2020-02-04 21:37:12.964610: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libnvinfer.so.6'; dlerror: libnvinfer.so.6: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /usr/local/cuda-10.1/lib64:/usr/local/cuda-10.1/lib64
2020-02-04 21:37:12.964749: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libnvinfer_plugin.so.6'; dlerror: libnvinfer_plugin.so.6: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /usr/local/cuda-10.1/lib64:/usr/local/cuda-10.1/lib64
2020-02-04 21:37:12.964777: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:30] Cannot dlopen some TensorRT libraries. If you would like to use Nvidia GPU with TensorRT, please make sure the missing libraries mentioned above are installed properly.
>>> print(tf.test.is_gpu_available())
WARNING:tensorflow:From <stdin>:1: is_gpu_available (from tensorflow.python.framework.test_util) is deprecated and will be removed in a future version.
Instructions for updating:
Use `tf.config.list_physical_devices('GPU')` instead.
2020-02-04 21:37:37.267421: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 1795795000 Hz
2020-02-04 21:37:37.268461: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x55913b67a840 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
2020-02-04 21:37:37.268516: I tensorflow/compiler/xla/service/service.cc:176]  StreamExecutor device (0): Host, Default Version
2020-02-04 21:37:37.272139: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcuda.so.1
2020-02-04 21:37:37.481038: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2020-02-04 21:37:37.481712: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x55913b6eb960 initialized for platform CUDA (this does not guarantee that XLA will be used). Devices:
2020-02-04 21:37:37.481755: I tensorflow/compiler/xla/service/service.cc:176]  StreamExecutor device (0): GeForce GTX 1060 3GB, Compute Capability 6.1
2020-02-04 21:37:37.482022: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2020-02-04 21:37:37.482528: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1555] Found device 0 with properties: 
pciBusID: 0000:03:00.0 name: GeForce GTX 1060 3GB computeCapability: 6.1
coreClock: 1.7085GHz coreCount: 9 deviceMemorySize: 5.93GiB deviceMemoryBandwidth: 178.99GiB/s
2020-02-04 21:37:37.482953: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudart.so.10.1
2020-02-04 21:37:37.485492: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcublas.so.10
2020-02-04 21:37:37.487486: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcufft.so.10
2020-02-04 21:37:37.487927: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcurand.so.10
2020-02-04 21:37:37.490469: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcusolver.so.10
2020-02-04 21:37:37.491950: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcusparse.so.10
2020-02-04 21:37:37.499031: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudnn.so.7
2020-02-04 21:37:37.499301: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2020-02-04 21:37:37.500387: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2020-02-04 21:37:37.500847: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1697] Adding visible gpu devices: 0
2020-02-04 21:37:37.500941: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudart.so.10.1
2020-02-04 21:37:37.502172: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1096] Device interconnect StreamExecutor with strength 1 edge matrix:
2020-02-04 21:37:37.502212: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1102]   0 
2020-02-04 21:37:37.502229: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1115] 0:  N 
2020-02-04 21:37:37.502436: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2020-02-04 21:37:37.503003: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2020-02-04 21:37:37.503593: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1241] Created TensorFlow device (/device:GPU:0 with 2934 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1060 3GB, pci bus id: 0000:03:00.0, compute capability: 6.1)
True
>>>

返回的True,說明可以

通過pycharm卻不行,如下圖,返回False

解決辦法:

1.修改~/.bashrc

將pycahrm的路徑加到環(huán)境中,示例如下:

alias pycharm="bash /home/answer/文檔/pycharm-professional-2019.3.2/pycharm-2019.3.2/bin/pycharm.sh"

刷新生效:

source ~/.bashrc

2.修改pycharm中的環(huán)境變量

選擇pycharm 菜單欄Run ——> Run-Edit Configurations ——> Environment variables——> 將cuda的路徑加進去 例如:LD_LIBRARY_PATH=/usr/local/cuda-10.1/lib64

在運行就可以了

到此這篇關(guān)于解決Ubuntu18中的pycharm不能調(diào)用tensorflow-gpu的問題的文章就介紹到這了,更多相關(guān)pycharm不能調(diào)用tensorflow-gpu內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

  • python 公共方法匯總解析

    python 公共方法匯總解析

    這篇文章主要介紹了python 公共方法匯總解析,文中通過示例代碼介紹的非常詳細,對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友可以參考下
    2019-09-09
  • Python連接數(shù)據(jù)庫并批量插入包含日期記錄的操作

    Python連接數(shù)據(jù)庫并批量插入包含日期記錄的操作

    這篇文章主要介紹了Python連接數(shù)據(jù)庫并批量插入包含日期記錄的操作,文章圍繞主題展開詳細的內(nèi)容介紹,具有一定的參考價值,需要的小伙伴可以參考一下
    2022-06-06
  • Python虛擬機棧幀對象及獲取源碼學(xué)習(xí)

    Python虛擬機棧幀對象及獲取源碼學(xué)習(xí)

    這篇文章主要為大家介紹了Python虛擬機棧幀對象及獲取源碼學(xué)習(xí),有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進步,早日升職加薪
    2023-03-03
  • 使用實現(xiàn)XlsxWriter創(chuàng)建Excel文件并編輯

    使用實現(xiàn)XlsxWriter創(chuàng)建Excel文件并編輯

    今天小編就為大家分享一篇使用實現(xiàn)XlsxWriter創(chuàng)建Excel文件并編輯,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧
    2018-05-05
  • python實現(xiàn)簡易版計算器

    python實現(xiàn)簡易版計算器

    這篇文章主要為大家詳細介紹了python實現(xiàn)簡易版計算器,文中示例代碼介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2018-01-01
  • Python利用itchat庫向好友或者公眾號發(fā)消息的實例

    Python利用itchat庫向好友或者公眾號發(fā)消息的實例

    今天小編就為大家分享一篇Python利用itchat庫向好友或者公眾號發(fā)消息的實例,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧
    2019-02-02
  • Python的命令行參數(shù)實例詳解

    Python的命令行參數(shù)實例詳解

    python中有一個模塊sys,sys.argv這個屬性提供了對命令行參數(shù)的訪問,下面這篇文章主要給大家介紹了關(guān)于Python命令行參數(shù)實例的相關(guān)資料,文中通過實例代碼介紹的非常詳細,需要的朋友可以參考下
    2022-02-02
  • Python實現(xiàn)單例模式的多種方法總結(jié)

    Python實現(xiàn)單例模式的多種方法總結(jié)

    單例模式是最常使用的一種設(shè)計模式,該模式的目的是確保在一個系統(tǒng)中,一個類只有一個實例,本文給大家介紹了Python實現(xiàn)單例模式的完整指南:原理、方法與最佳實踐,需要的朋友可以參考下
    2025-04-04
  • python 字典修改鍵(key)的幾種方法

    python 字典修改鍵(key)的幾種方法

    這篇文章主要介紹了python 字典修改鍵(key)的幾種方法,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧
    2018-08-08
  • Python正則表達式急速入門(小結(jié))

    Python正則表達式急速入門(小結(jié))

    這篇文章主要介紹了Python正則表達式急速入門(小結(jié)),文中通過示例代碼介紹的非常詳細,對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2019-12-12

最新評論

类乌齐县| 汶上县| 河西区| 平谷区| 侯马市| 沁水县| 富蕴县| 台北县| 福泉市| 晋江市| 闽清县| 卢龙县| 镇巴县| 南和县| 衡阳市| 忻州市| 永顺县| 开化县| 昆明市| 民和| 通州区| 凉城县| 扬中市| 平利县| 腾冲县| 澳门| 德化县| 东乡县| 错那县| 吴忠市| 鄂托克旗| 兴安盟| 开江县| 翁源县| 确山县| 天全县| 兴和县| 大邑县| 新密市| 绥芬河市| 巩留县|