pyinstaller打包深度學習相關套件, 如tensorflow, keras,...,

版本會影響打包是否成功之問題,

本版測試tensorflow-gpu版本成功版本如下:

版本一:

tensorflow-gpu = 1.11.0

keras = 2.1.6

numpy = 1.15.3

python = 3.6.1

cuda = 9.0

cudnn = 7.1

 

版本二:

tensorflow-gpu = 1.13.1

keras = 2.1.6

numpy = 1.16.2

python = 3.6.2

cuda = 10.0

cudnn = 7.5.1

 

上述版本打包成exe檔後可正常執行,

另外,

安裝pyinstaller後如無法正常打包,

請確認是否有安裝setuptools以及pyqt5,

安裝setuptools指令: python -m pip install -U pip setuptools

安裝pyqt5指令: pip install pyqt5 

 

tensorflow-gpu=1.11.0 搭配的setuptools版本<=39.1.0

tensorflow-gpu=1.13.1 搭配的setuptools版本>=39.1.0

假設已安裝本版過高的setuptools先卸載在安裝,

卸載setuptools指令: pip uninstall setuptools

安裝特定版本setuptools指令: pip install setuptools==39.1.0

 

先前測試打包錯誤之版本:

tensorflow-gpu = 1.8.0

numpy = 1.13.3

python = 3.6.1

cuda = 9.0

cudnn = 7.1

錯誤訊息如下:

ImportError: No module named '_pywrap_tensorflow_internal'

↑上述問題只要修改tensorflow版本即可

 

 

補充:

安裝與執行pyinstaller套件參考: 點擊我

arrow
arrow

    楓綺 發表在 痞客邦 留言(0) 人氣()