Closed Neo-YH closed 4 years ago
pred列表里放的字典里的数据应该是float型的为什么报的int64呢
按照网上的方法,自定义了一下serialize的方法,好像不行 应该是要把numpy.int64转成python里有的数据类型吧
多亏了朋友的帮助,发现cat_id还要int强制转化一下
是这行代码?我之前都直接输出tracking,所以没有遇到这个问题
是的,加了int之后这里没问题了,原理我还不太明白
res里面各项注释了一遍,发现是cat_id这里的问题,然后加了个int转换试试
感谢,我待会更新代码。这个错误很常见,python自带的json不会自动转换numpy的数据类型
多谢学长,是我该说感谢。还有个问题想问一下
我看进度条用的是利用tqdm输出的,这两个进度条都是0%,是不是读取视频还是存在问题呀
请把完整的报错信息以及你运行的命令粘贴下来
运行命令: python obj_detect_tracking.py --model_path obj_v3_model --version 3 --video_dir v1-val_testvideos --video_lst_file v1-val_testvideos.lst --out_dir test_json_out --frame_gap 1 --get_tracking --tracking_dir testtrack
/home/c1080/anaconda3/envs/tf/lib/python3.6/site-packages/sklearn/utils/linearassignment.py:22: FutureWarning: The linearassignment module is deprecated in 0.21 and will be removed from 0.23. Use scipy.optimize.linear_sum_assignment instead. FutureWarning) 0%| | 0/1 [00:00<?, ?it/s]<VideoCapture 0x7fd7b86b7410> 0%| | 0/1 [00:04<?, ?it/s] Traceback (most recent call last): File "/home/c1080/anaconda3/envs/tf/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1334, in _do_call return fn(*args) File "/home/c1080/anaconda3/envs/tf/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1319, in _run_fn options, feed_dict, fetch_list, target_list, run_metadata) File "/home/c1080/anaconda3/envs/tf/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1407, in _call_tf_sessionrun run_metadata) tensorflow.python.framework.errors_impl.InvalidArgumentError: indices[1] = [0] is repeated [[{{node fastrcnn_predictions/map/while/SparseToDense}} = SparseToDense[T=DT_BOOL, Tindices=DT_INT32, _class=["loc:@fastrcnn_predictions/map/while/TensorArrayWrite/TensorArrayWriteV3"], validate_indices=true, _device="/job:localhost/replica:0/task:0/device:CPU:0"](fastrcnn_predictions/map/while/Neg_1/_1301, fastrcnn_predictions/map/while/Shape/_1303, fastrcnn_predictions/map/while/SparseToDense/sparse_values/_1305, fastrcnn_predictions/map/while/SparseToDense/default_value/_1307)]] [[{{node fastrcnn_predictions/map/while/TensorArrayWrite/TensorArrayWriteV3/_1315}} = _Recvclient_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device_incarnation=1, tensor_name="edge_4724_fastrcnn_predictions/map/while/TensorArrayWrite/TensorArrayWriteV3", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:GPU:0"]]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "obj_detect_tracking.py", line 614, in
Caused by op 'fastrcnn_predictions/map/while/SparseToDense', defined at:
File "obj_detect_tracking.py", line 480, in
InvalidArgumentError (see above for traceback): indices[1] = [0] is repeated [[node fastrcnn_predictions/map/while/SparseToDense (defined at /home/c1080/zyh/ObjectDetectionTracking/Object_Detection_Tracking-master/models.py:1222) = SparseToDense[T=DT_BOOL, Tindices=DT_INT32, _class=["loc:@fastrcnn_predictions/map/while/TensorArrayWrite/TensorArrayWriteV3"], validate_indices=true, _device="/job:localhost/replica:0/task:0/device:CPU:0"](fastrcnn_predictions/map/while/Neg_1/_1301, fastrcnn_predictions/map/while/Shape/_1303, fastrcnn_predictions/map/while/SparseToDense/sparse_values/_1305, fastrcnn_predictions/map/while/SparseToDense/default_value/_1307)]] [[{{node fastrcnn_predictions/map/while/TensorArrayWrite/TensorArrayWriteV3/_1315}} = _Recvclient_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device_incarnation=1, tensor_name="edge_4724_fastrcnn_predictions/map/while/TensorArrayWrite/TensorArrayWriteV3", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:GPU:0"]]
再跑没出现这个报错了,就abort了
/home/c1080/anaconda3/envs/tf/lib/python3.6/site-packages/sklearn/utils/linearassignment.py:22: FutureWarning: The linearassignment module is deprecated in 0.21 and will be removed from 0.23. Use scipy.optimize.linear_sum_assignment instead.
这个warning不应该出现,请更新代码(deep_sort/)
你的video里是否有avi格式,有的话参照这个example 加 --use_lijun
或者--use_moviepy
好的,我现在试试,video是测试用的MP4 wget https://aladdin-eax.inf.cs.cmu.edu/shares/diva_obj_detect_models/models/v1-val_testvideos.tgz
我更新了代码和README并测试过了,可以git pull
一下然后再试试。
我赶紧试试,感谢学长
学长,我想问一下你用的tensorflow-gpu的版本号,能看一下你配置的环境吗
tf 1.15.2, CUDA 10.0, cuDNN 7.6
出现了这个报错,我试试能不能解决它。要是解决了我把方法发布上来,总是麻烦学长解答真不好意思。