- 博客(3)
- 收藏
- 关注
原创 用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 224
原创 代码问题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 1311
原创 用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 695
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人