TensorFlow中models的安装

 

 一、问题

       今天在进行LSTM实验的时候,TensorFlow环境中未安装models就会报错,下图中reader下会飘红:

  然后,寻找解决办法,发现之前安装TensorFlow的时候没有安装models的模块,所以这里进一步安装完善。 

 二、安装model

       安装model的过程需要git tensorflow的官方源码(https://github.com/tensorflow/models)。具体操作方式为:

git clone --recurse-submodules https://github.com/tensorflow/models

或者到百度云盘进行下载:https://pan.baidu.com/s/1vs7fbN8j03ErV9s9AbMkag 密码:97os,然后将对应的文件放入\Anaconda3\Lib\site-packages\tensorflow\  文件夹下面即可。

 三、测试是否安装成功。我的测试中又报如下错误:

     解决此问题,点进去_init_.py 

将
     import reader
     import util
修改为:
     from tensorflow.models.tutorials.rnn.ptb import reader
     from tensorflow.models.tutorials.rnn.ptb import util

再次测试后成功运行。 

 

参考文章:

https://blog.youkuaiyun.com/hh_2018/article/details/79779794

https://blog.youkuaiyun.com/ting_163/article/details/80597150

https://github.com/tensorflow/

https://blog.youkuaiyun.com/m0_37917271/article/details/82350571#commentBox

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值