![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
报错
cofisher
这个作者很懒,什么都没留下…
展开
-
AttributeError: module ‘tensorflow_federated‘ has no attribute ‘type_at_clients‘
项目说明在学习联邦学习时在使用 tff.type_at_clients 函数时报如下错误:---------------------------------------------------------------------------AttributeError Traceback (most recent call last)<ipython-input-17-8b22508bfb3f> in <module>-原创 2021-04-20 09:15:04 · 493 阅读 · 0 评论 -
Jupyter Notebook出现kernel error情况
可能是在anaconda中安装了新环境后直接在prompt中输入jupyter notebook此时打开的是之前的其他环境的jupyter此时需要在新环境中重新pip install jupyter原创 2021-04-16 10:43:37 · 264 阅读 · 0 评论 -
Tensorflow2.0 求梯度返回None(WARNING:tensorflow:Gradients do not exist for variables)
问题说明利用梯度带计算梯度时发现有些层的梯度返回None。解决方法将正向传播中所有的操作都用tensorflow中的API执行,不能使用numpy等其他库中的API,比如np.concatenate需要被换成tf.concat。原创 2021-02-05 23:42:22 · 3972 阅读 · 0 评论 -
Tensorflow2.0 保存模型时出现 NotImplementedError 的解决方法
错误描述如果保存用类定义的模型,那么很有可能会出现以下错误:NotImplementedError: Saving the model to HDF5 format requires the model to be a Functional model or a Sequential model. It does not work for subclassed models, because such models are defined via the body of a Python method,原创 2020-07-27 15:29:03 · 3731 阅读 · 0 评论 -
Tensorflow2.0 读取保存的模型时, 产生错误 [ValueError: Unknown activation function:relu6]
查看在建立模型过程中,定义 relu6 激活函数时是否使用了 tf.keras.layers.Activation(tf.nn.relu6),如果有的话,将其更改为:tf.keras.layers.ReLU(6.)原创 2020-07-22 10:30:58 · 1798 阅读 · 0 评论 -
swapon: /swap/swap: insecure permissions 0644, 0600 suggested.
在 Ubuntu 系统中增加 swap 交换空间时遇到如题错误。报错代码sudo swapon sfile解决方法sudo chmod 600 swap原创 2020-07-03 23:06:25 · 11114 阅读 · 0 评论 -
TypeError: float() argument must be a string or a number, not ‘Dimension‘
出错代码tf.convert_to_tensor(inputs.shape[0], dtype=tf.float32)解决方法tf.convert_to_tensor(inputs.shape[0].value, dtype=tf.float32)原创 2020-07-03 21:22:57 · 4417 阅读 · 0 评论 -
RuntimeError: iter() is only supported inside of tf.function or when eager execution is enabled.
这是由于程序中用到了动态图机制,允许不创建静态图的情况下执行程序,对于 Tensorflow 2.0 以下的版本,需要在 import tensorflow 后,调用 tf.enable_eager_execution() 来启动动态图机制;对于 2.0 以上的版本来说,动态图机制是默认打开的,但如果仍出现这个错误,也可以调用 tf.enable_eager_execution() 来解决。...原创 2020-06-28 15:08:26 · 4948 阅读 · 1 评论