![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
tensorflow
cxxx17
为什么可乐一定要加冰
展开
-
docker 常用命令
检查docker是否安装成功:docker run hello-world查看正在运行的dockerdocker ps关闭docker# docker stop [CONTAINER ID]docker stop d6734fd5809c原创 2021-06-15 22:47:35 · 113 阅读 · 0 评论 -
【debug】docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock.
docker run hello-world时,报错:docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?sudo service docker restart重启Docker引擎之后解决。原创 2021-06-09 18:30:26 · 110 阅读 · 0 评论 -
tensorflow serving部署tensorflow模型
tensorflow serving部署tensorflow模型原创 2021-06-08 23:42:02 · 123 阅读 · 2 评论 -
【debug】自定义层保存模型时出现 AttributeError: ‘NoneType‘ object has no attribute ‘replace‘
自定义层保存模型 tf.saved_model.save(model, f’{log_dir}/pb’)# 自定义的层class ScalarLayer(tf.keras.layers.Layer): def __init__(self, scalar_shape=3): super(ScalarLayer, self).__init__() self.w = self.add_weight(name=name, shape=(1, scalar_shape, 1原创 2021-03-05 13:29:28 · 4924 阅读 · 0 评论 -
【debug】tensorflow训练GPU利用率为0
在跑一个基于tensorflow的代码时,发现指定了GPU后,只占了很小的显存,且GPU利用率为0。经核查发现是tensorflow-gpu版本和cuda版本没对上,(也没报错。。gucci)tensorflow-gpu版本1.15.0原cuda:10.1更改为10.0后问题解决。...原创 2021-01-20 10:15:22 · 3246 阅读 · 2 评论 -
【debug】Failed building wheel for grpcio 解决
pip安装tensorflow时出现Bug: Failed building wheel for grpcio// 原代码pip install tensorflow==1.11update pip 后解决pip install --upgrade pippip install tensorflow==1.11原创 2021-01-10 22:17:16 · 12843 阅读 · 3 评论 -
Failed to convert object of type class ‘tuple‘ to Tensor错误
Failed to convert object of type class 'tuple' to Tensor错误tf2遇到的错误记录一下:link转载 2020-09-18 15:13:40 · 1547 阅读 · 0 评论 -
离线安装tensorflow-gpu
离线安装tensorflow-gpu因为有的服务器能联外网,有的服务器不能联外网,想在不能联网的服务器上安装环境就比较坑了。采用的办法是先在能联网的服务器下载好,再移到不能联网的服务器离线安装。想安装的tensorflow的版本是tensorflow-gpu 1.141.在能联网的机器下载安装包和相关的依赖包创建一个虚拟环境,最好python版本和目标python版本一致conda create -n tf1.14 python=3.6.5激活虚拟环境,并下载tensorflow相关的w原创 2020-09-09 10:56:23 · 1219 阅读 · 0 评论 -
TypeError: call() missing 1 required positional argument: ‘target‘
TypeError: call() missing 1 required positional argument: ‘target’使用tf.save_model()时,出现Bug,将模型文件中的call()改为__call__()原创 2020-12-10 15:03:21 · 3592 阅读 · 0 评论 -
WARNING:not built warning
WARNING:tensorflow:Skipping full serialization of Keras layer <tensorflow.python.keras.layers.recurrent_v2.LSTM object at 0x7f7e240ee240>, because it is not built.在model init里面写了前向没有用到的层。// define modelclass BLSTM(tf.keras.Model): def __init__(se原创 2020-11-03 15:18:38 · 2094 阅读 · 0 评论 -
ERROR:Input to reshape is a tensor with 41 values, but the requested shape requires a multiple of 16
inference时,出现了tensorflow的error: Input to reshape is a tensor with 41 values, but the requested shape requires a multiple of 16.原因是在写模型时用到了shape(tensor)而不是tf.shape(tensor).原代码max_sentence_size = shape(text)[1]new_a = tf.reshape(tensor=a,原创 2020-10-23 11:18:11 · 1145 阅读 · 1 评论