python-2.7 - cv2.error: OpenCV(4.1.0) /io/opencv/modules/imgproc/src/resize.cpp:3555: 错误: (-215:Assertion failed) func != 0 && cn <= 4 in function'resize'
问题描述
我正在尝试使用 cv2.resize 调整 (720,1280,3) 数组的大小,
data['motion_vector'] = cv2.resize(data['motion_vector'], (int(feat_shape[0][3]), int(feat_shape[0][2])), interpolation = cv2.INTER_AREA)
但我遇到了这样的错误:
Traceback (most recent call last):
File "experiments/mvff_rfcn/mvff_rfcn_end2end_train_test.py", line 20, in <module>
train_end2end.main()
File "experiments/mvff_rfcn/../../mvff_rfcn/train_end2end.py", line 213, in main
config.TRAIN.lr_step
File "experiments/mvff_rfcn/../../mvff_rfcn/train_end2end.py", line 101, in train_net
bbox_std=config.network.ANCHOR_STDS
File "experiments/mvff_rfcn/../../mvff_rfcn/core/loader.py", line 265, in __init__
self.get_batch_individual()
File "experiments/mvff_rfcn/../../mvff_rfcn/core/loader.py", line 414, in get_batch_individual
rst.append(self.parfetch(iroidb))
File "experiments/mvff_rfcn/../../mvff_rfcn/core/loader.py", line 438, in parfetch
data['motion_vector'] = cv2.resize(data['motion_vector'], (int(feat_shape[0][3]), int(feat_shape[0][2])), interpolation = cv2.INTER_AREA)
cv2.error: OpenCV(4.1.0) /io/opencv/modules/imgproc/src/resize.cpp:3555: error: (-215:Assertion failed) func != 0 && cn <= 4 in function 'resize'
解决方案
推荐阅读
- docker - 在 kubernetes 中运行最新的 elasticsearch 集群
- php - Laravel 5.8 获取属于用户的表
- visual-studio-code - 文件问题的自定义问题匹配器
- java - 外部静态 html 视图解析器 + thymeleaf
- database - oracle关联子查询,过滤结果
- python - Pyspark KMeans 聚类特征列 IllegalArgumentException
- c# - Visual Studio - Web 项目 - 添加现有区域文件夹
- c# - HitHighlight 仅适用于当前范围
- c# - 即使使用值实体框架,实体属性也为空
- flask - 使用 SQLAlchemy 提交表单会抛出“列表”对象没有属性