机器学习
spicy strip
这个作者很懒,什么都没留下…
展开
-
module ‘tensorflow.compat.v1‘ has no attribute ‘contrib‘
-initializer = tf.contrib.layers.xavier_initializer(seed=1) import tensorflow.compat.v1 as tf tf.disable_v2_behavior() initializer = tf.truncated_normal_initializer(stddev=0.1)原创 2021-04-13 15:04:02 · 416 阅读 · 0 评论 -
keras使用Merge报错解决
keras使用Merge报错 在使用新版的高于2.1.6的keras使用merge函数可能会报错:TypeError: 'module' object is not callable。此时有两个办法可以解决。 解决Keras使用Merge报错 mode:合并模式,如果为字符串,则为下列值之一{“sum”,“mul”,“concat”,“ave”,“cos”,“dot”} 以mul为例,其现在改为Multiply,例如 mf_vector = Multiply()([mf_user_latent, mf_i原创 2021-04-05 20:11:55 · 1286 阅读 · 0 评论 -
no module name merge
在学习使用keras.layers的merge函数时(merge7 = merge([conv3,up7], mode = ‘concat’, concat_axis = 3)),报错了,原因是被废弃了,可以改成导入from keras.layers import concatenate,merge7 = concatenate([conv3, up7], axis=3)。同样,其他merge9也是参照以上方法更改。 ...原创 2020-11-29 16:00:51 · 650 阅读 · 0 评论 -
在使用tensorflow时报错——no kernel image is available for execution on the device
no kernel image is available for execution on the device 使用tensorflow时候,报了一个错误“no kernel image is available for execution on the device”,那么这个是由于GPU算力不足导致的,可以尝试安装低版本的cuda和低版本的tensorfolw。 例如我的显卡是930.我安装的cuda是8.0,然后tensorflow是1.15. 使用语句pip install tensorflow=原创 2020-11-29 15:54:36 · 1067 阅读 · 0 评论