![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
深度学习
文章平均质量分 85
深度学习的知识
飘在风中的鱼
这个作者很懒,什么都没留下…
展开
-
用Tensorflow API:tf.keras搭建网络八股(二)
用Tensorflow API:tf.keras搭建网络八股(二)前面第一部分写了用Sequential来设计网络结构,但是也有一些弊端,Sequential无法设计一些带有跳连接的非顺序网络结构,这个时候可以选择用Class类来自定义网络结构。class MyModel(Model):def __init__(self):super(MyModel, self).__init__()定义网络结构块def call(self, x):调用网络结构块,实现前向传播return ymodel原创 2020-05-26 11:29:58 · 213 阅读 · 0 评论 -
代码问题1:出现AttributeError: RefVariable object has no attribute numpy
Tensorflow出现AttributeError: ‘RefVariable’ object has no attribute 'numpy’如下错误信息代码中使用x.numpy()输出信息时报错斜体样式import tensorflow as tfignition = tf.Variable(451, tf.int16)print(ignition.numpy())AttributeError Traceback (most recen原创 2020-05-25 20:16:31 · 1300 阅读 · 0 评论 -
用Tensorflow API:tf.keras搭建网络八股(一)
用Tensorflow API:tf.keras搭建网络八股目录一、导包二、导入数据集三、Sequential搭建网络四、compile配置训练方法五、fit执行训练过程六、summary输出网络结构及参数七、总体代码目录Tensorflow2.0的API:tf.keras来搭建网络八股,以鸢尾花数据集来演示。一、导包首先导入需要的包:import tensorflow as tffrom sklearn import datasetsimport numpy as np二、导入数据集t原创 2020-05-24 14:55:19 · 678 阅读 · 0 评论