- 错误一:
- 报错:
RuntimeError: tf.gradients is not supported when eager execution is enabled. Use tf.GradientTape instead.
- 报错原因:chow_output类型是tf.tensor,last_conv_layer是keras.layers.convolustional.conv2d.Conv2D 出现类型不兼容,查询到的解决方法是直接替换为使用tensorflow中的keras.
- 解决:
原始代码: grads=K.gradients(chow_output,last_conv_layer)[0] # 松狮类别相对于block5_conv3输出特征图的梯度 修改后的代码: with tf.GradientTape() as gtape: grads = gtape.gradient(chow_output, last_conv_layer.output)
- 报错:
- 错误二:
- 报错:
module 'cv2.cv2' has no attribute 'xfeatures2d'
- 报错:
- 错误三:
- 报错:
error: (-215:Assertion failed) npoints >= 4 && npoints == std::max(ipoints.checkVector(2, CV_32F), ipoints.checkVector(2, CV_64F)) in function 'cv::solvePnPRansac'
- 报错:
- 错误四:
- 报错:
The 'color' trait of a GlyphFactory instance must be a tuple of the form: (0.0 <= a floating point number <= 1.0, 0.0 <= a floating point number <= 1.0, 0.0 <= a floating point number <= 1.0) or None, but a value of array([0.70980392, 0.69019608, 0.67843137]) <class 'numpy.ndarray'> was specified.
- 解决:报错信息已很明显地提示,解决:只需要将array中的元素逐个拿出然后用括号括起来即可形成tuple
- 报错:
- 错误五:
- 报错:module 'sklearn.datasets' has no attribute 'samples_generator'
- 解决:删除samples_generator
- 错误六:
- 报错:报错:ImportError: No module named ‘keras_contrib‘
- 解决:pip install git+https://www.github.com/keras-team/keras-contrib.git
9.27---报错整理
最新推荐文章于 2023-03-13 11:42:04 发布