项目场景:
debug的时候报错ModuleNotFoundError: No module named ‘tfsnippet’。
解决方案:
1.git下载tfsnippet,如链接所示https://gitee.com/obouluh/tfsnippet。
2.需要使用git工具。安装方式如下:
1)在官网下载安装包:https://git-scm.com/downloads。
2)按照默认选项安装git软件。
3)打开软件,输入指令:
首先安装tensorflow1.15以上版本。
pip install tensorflow==1.15.4 -i https://pypi.tuna.tsinghua.edu.cn/simple
安装依赖:
pip install git+https://github.com/thu-ml/zhusuan.git
安装 tfsnippet:
pip install git+https://github.com/haowen-xu/tfsnippet.git
如果报错则在install后面加上–user,赋予管理员权限,即如下指令:
pip install --user git+https://github.com/haowen-xu/tfsnippet.git
报错截图:
正确安装截图:
成功!