reallongnguyen / Optical-Flow-Guided-Feature

Code for paper: Optical Flow Guided Feature: A Fast and Robust Motion Representation for Video Action Recognition
MIT License
27 stars 11 forks source link

Hỏi cách train. #2

Closed ghost closed 6 months ago

ghost commented 5 years ago

Cảm ơn bạn. Một project tuyệt vời. Bạn có blog hay bài hướng dẫn chi tiết không? Bạn có biết cách để train dữ liệu do mình tạo ra không? Rất mong bạn hồi âm.

reallongnguyen commented 5 years ago

Chào bạn, cảm ơn câu hỏi của bạn :3 Sr bạn vì dạo này mình không còn dành nhiều thời gian cho lĩnh vực này nữa nên document quá sơ sài.

Để train mô hình này thì bạn cần chuẩn bị dữ liệu, sau đó chạy các file

Để chuẩn bị dữ liệu thì bạn tải 1 dataset nào đó về và để trong thư mục data, sau đó chia nó thành tập train trainlist.txt và tập test testlist.txt. Sau đó bạn chạy file dataset/convert_[dataset_name].py để chuyển dữ liệu về dạng tfrecord. Đến đây là xong bước chuẩn bị dữ liệu.

Mình từng làm với bộ dữ liệu UCF 11. Bạn có thể đọc thêm ở các file code mình viết để xử lý cho bộ dữ liệu này. Do mình code và train từ khá lâu rồi nên có thể một số bước mình nói chưa chi tiết, Có vấn đề gì hãy liên lạc với mình.

// Nếu được thì bạn có thể viết document chi tiết hơn và gửi merge quest cho mình được không ạ, mình nghĩ sẽ có một số bạn cũng muốn được hướng dẫn chi tiết hơn.

ghost commented 5 years ago

Cảm ơn bạn đã trả lời. Về bộ dataset UCF 11 thì mình thấy không có vấn đề gì khi chuẩn bị dữ liệu nhưng khi mình chuyển qua làm với bộ UCF 101 thì mình gặp rất nhiều lỗi. Không biết trước đây bạn đã làm với bộ UCF 101 chưa?

ghost commented 5 years ago

`

Converting image 129/1432134 shard 0 path: data/UCF101/HighJump/v_HighJump_g01_c03.avi Converting image 130/1432134 shard 0 path: data/UCF101/FrontCrawl/v_FrontCrawl_g07_c03.avi Converting image 131/1432134 shard 0 path: data/UCF101/Rowing/v_Rowing_g09_c03.avi Converting image 132/1432134 shard 0 path: data/UCF101/PlayingGuitar/v_PlayingGuitar_g10_c07.avi Converting image 133/1432134 shard 0 path: data/UCF101/Swing/v_Swing_g23_c02.avi Converting image 134/1432134 shard 0 path: data/UCF101/UnevenBars/v_UnevenBars_g20_c01.avi Converting image 135/1432134 shard 0 path: data/UCF101/StillRings/v_StillRings_g02_c04.avi Converting image 136/1432134 shard 0 path: data/UCF101/JugglingBalls/v_JugglingBalls_g02_c05.avi Converting image 137/1432134 shard 0 path: data/UCF101/PlayingDhol/v_PlayingDhol_g07_c06.avi Converting image 138/1432134 shard 0 path: data/UCF101/BasketballDunk/v_BasketballDunk_g17_c05.avi Converting image 139/1432134 shard 0 path: data/UCF101/Biking/v_Biking_g03_c04.avi Traceback (most recent call last): File "convert_ucf101.py", line 67, in tf.app.run() File "/usr/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 125, in run _sys.exit(main(argv)) File "convert_ucf101.py", line 61, in main convert_ucf101_1.run(FLAGS.dataset_dir) File "/headless/Optical-Flow-Guided-Feature/datasets/convert_ucf101_1.py", line 240, in run dataset_dir) File "/headless/Optical-Flow-Guided-Feature/datasets/convert_ucf101_1.py", line 159, in _convert_dataset videodata, fc, height, width, , _ = video_reader.convert_video_to_numpy(filenames[i]) File "/headless/Optical-Flow-Guided-Feature/datasets/convert_ucf101_1.py", line 76, in convert_video_to_numpy image = cv2.resize(image, (height, width)) cv2.error: OpenCV(4.1.0) /io/opencv/modules/imgproc/src/resize.cpp:3718: error: (-215:Assertion failed) !ssize.empty() in function 'resize' `

Đây là lỗi mình gặp phải khi convert bộ UCF 101. Có phải do dữ liệu của họ bị hỏng hay do mình chỉnh code chưa đúng?