Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'NoneType' object has no attribute 'group' #110

Open
LLF-afk opened this issue Nov 14, 2024 · 15 comments
Open

AttributeError: 'NoneType' object has no attribute 'group' #110

LLF-afk opened this issue Nov 14, 2024 · 15 comments

Comments

@LLF-afk
Copy link

LLF-afk commented Nov 14, 2024

Traceback (most recent call last):

File "/22085400415/leilanfang/smoke_fusion_theraml/YOLOV-master3/tools/vid_train.py", line 131, in
launch(
└ <function launch at 0x7fbdcd768670>

File "/22085400415/leilanfang/smoke_fusion_theraml/YOLOV-master3/yolox/core/launch.py", line 98, in launch
main_func(*args)
│ └ (╒════════════════════╤══════════════════════════════════════════════════════════════════════════════════════════════════════...
└ <function main at 0x7fbdc45c75e0>

File "/22085400415/leilanfang/smoke_fusion_theraml/YOLOV-master3/tools/vid_train.py", line 115, in main
trainer.train()
│ └ <function Trainer.train at 0x7fbdc45c5d30>
└ <yolox.core.vid_trainer.Trainer object at 0x7fbe446d6640>

File "/22085400415/leilanfang/smoke_fusion_theraml/YOLOV-master3/yolox/core/vid_trainer.py", line 122, in train
self.train_in_epoch()
│ └ <function Trainer.train_in_epoch at 0x7fbdc45c5dc0>
└ <yolox.core.vid_trainer.Trainer object at 0x7fbe446d6640>

File "/22085400415/leilanfang/smoke_fusion_theraml/YOLOV-master3/yolox/core/vid_trainer.py", line 132, in train_in_epoch
self.after_epoch()
│ └ <function Trainer.after_epoch at 0x7fbdc45c7160>
└ <yolox.core.vid_trainer.Trainer object at 0x7fbe446d6640>

File "/22085400415/leilanfang/smoke_fusion_theraml/YOLOV-master3/yolox/core/vid_trainer.py", line 278, in after_epoch
self.evaluate_and_save_model()
│ └ <function Trainer.evaluate_and_save_model at 0x7fbdc45c7430>
└ <yolox.core.vid_trainer.Trainer object at 0x7fbe446d6640>

File "/22085400415/leilanfang/smoke_fusion_theraml/YOLOV-master3/yolox/core/vid_trainer.py", line 387, in evaluate_and_save_model
detail_info = extract_values(summary_info)
│ └ 'Average forward time: 0.00 ms, Average NMS time: 0.00 ms, Average inference time: 0.00 ms\n'
└ <function extract_values at 0x7fbdc45c5b80>

File "/22085400415/leilanfang/smoke_fusion_theraml/YOLOV-master3/yolox/core/vid_trainer.py", line 42, in extract_values
AP75 = re.search(r'Average Precision (AP) @[ IoU=0.75.*? ] = (\d+.\d+)', text).group(1)
│ │ └ 'Average forward time: 0.00 ms, Average NMS time: 0.00 ms, Average inference time: 0.00 ms\n'
│ └ <function search at 0x7fbe42e63af0>
└ <module 're' from '/opt/conda/lib/python3.8/re.py'>
AttributeError: 'NoneType' object has no attribute 'group'
在自制的数据集上出现这个问题,这个问题如何解决,是不是一个视频的帧数太少了

@auggieFT
Copy link

Its probably because data is not loading correctly.

@AngleBeats147753
Copy link

AngleBeats147753 commented Nov 20, 2024

This may be because the number of frames in all of your videos is less than lframe + gframe.

@LLF-afk
Copy link
Author

LLF-afk commented Nov 23, 2024

This may be because the number of frames in all of your videos is less than lframe + gframe.

请问你如何解决这个问题的?如果已经解决能否给我提供一些方案

@AngleBeats147753
Copy link

我是将默认的gframe从16 / 32 设置为 4 / 8。或者你可以让每个视频的帧数量大于32。(主要原因是dataset不会读取帧数量小于lframe + gframe的视频)

修改exps/customed_example/v++_SwinTiny_example.py中的self.gframeself.gframe_val

self.gframe = 4
self.gframe_val = 8 #config your gframe_val and gframe here

@LLF-afk
Copy link
Author

LLF-afk commented Nov 24, 2024

我是将默认的gframe从16 / 32 设置为 4 / 8。或者你可以让每个视频的帧数量大于32。(主要原因是dataset不会读取帧数量小于lframe + gframe的视频)

修改exps/customed_example/v++_SwinTiny_example.py中的self.gframeself.gframe_val

self.gframe = 4
self.gframe_val = 8 #config your gframe_val and gframe here

能否加一个联系方式呢,进一步回答呢,联系方式为qq:2926968068

@LLF-afk
Copy link
Author

LLF-afk commented Nov 24, 2024

This may be because the number of frames in all of your videos is less than lframe + gframe.

因为我现在主要是学习这个方向的

@LLF-afk
Copy link
Author

LLF-afk commented Nov 24, 2024

= 8 #config your gframe_val and gframe here

你好,我问一下你在自制的数据集上进行训练,效果如何?

@AngleBeats147753
Copy link

= 8 #config your gframe_val and gframe here

你好,我问一下你在自制的数据集上进行训练,效果如何?

不太好,可能是我数据集问题

@dilwolf
Copy link

dilwolf commented Dec 5, 2024

I got the same error. But my video frames vary between 200 and 300 frames for each video. I am trying to fine-tune YOLOv++ on a single class. Can this error be because of a single class (I think it is not a reason)? Any help or idea is really appreciated.

@LLF-afk
Copy link
Author

LLF-afk commented Dec 5, 2024

I got the same error. But my video frames vary between 200 and 300 frames for each video. I am trying to fine-tune YOLOv++ on a single class. Can this error be because of a single class (I think it is not a reason)? Any help or idea is really appreciated.

我是将默认的gframe从16 / 32 设置为 4 / 8。或者你可以让每个视频的帧数量大于32。(主要原因是dataset不会读取帧数量小于lframe + gframe的视频)

修改exps/customed_example/v++_SwinTiny_example.py中的self.gframe、self.gframe_val

self.gframe = 4
self.gframe_val = 8 #config your gframe_val and gframe here

你可以参考上面的,我也是按照这个进行改进的

@dilwolf
Copy link

dilwolf commented Dec 6, 2024

I got the same error. But my video frames vary between 200 and 300 frames for each video. I am trying to fine-tune YOLOv++ on a single class. Can this error be because of a single class (I think it is not a reason)? Any help or idea is really appreciated.

我是将默认的gframe从16 / 32 设置为 4 / 8。或者你可以让每个视频的帧数量大于32。(主要原因是dataset不会读取帧数量小于lframe + gframe的视频)

修改exps/customed_example/v++_SwinTiny_example.py中的self.gframe、self.gframe_val

self.gframe = 4 self.gframe_val = 8 #config your gframe_val and gframe here

你可以参考上面的,我也是按照这个进行改进的

Thank you so much for your reply, but when I got this issue first time, I tried above as you suggested. Unfortunately, it did not work for me. That's why I asked here. I am getting a similar error....

Anyway, below is my dataset:

Totally 95 videos, frames range from 200 to 300 for each video and I have single class. I splitted 20 for val set and 75 video sequences into train set. I am stuck into this problem. There is no progress.

I also re-prepared my json file structure based on json file in #115 but it did not work.

Do you think, guys is there any issue in my dataset?

@LLF-afk
Copy link
Author

LLF-afk commented Dec 6, 2024 via email

@dilwolf
Copy link

dilwolf commented Dec 6, 2024

What I want to know is what configuration file you used for training, and I didn't use the json file. If it's convenient for you, you can add me on QQ: 2926968068 Lei Lanfang @.***

------------------ Original Message ------------------ From: "Dilshod Bazarov @.>; Sent: Friday, December 6, 2024, 3:47 PM To: @.>; Cc: @.>; @.>; Subject: Re: [YuHengsss/YOLOV] AttributeError: ' NoneType' #39 ; object has no attribute ' group' #39 ; (Issue #110 ) I got the same error. But my video frames vary between 200 and 300 frames for each video. I am trying to fine-tune YOLOv++ on a single class. Can this error be because of a single class (I think it is not a reason)? Any help or idea is really appreciated. Thank you so much for your reply, but when I got this issue first time, I tried above as you suggested. Unfortunately, it did not work for me. That's why I asked here. I am getting a similar error.... Anyway, below is my dataset: Totally 95 videos, frames range from 200 to 300 for each video and I have single class. I splitted 20 for val set and 75 video sequences into train set. I am stuck into this problem. There is no progress. I also re-prepared my json file structure based on json file in #115 but it did not work. Do you think, guys is there any issue in my dataset? — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

Usually I do not use QQ. I will try to contact you soon,
But quick question? Do you mean exp file by saying configuration file? I am using the below CLI to train:

python tools/vid_train.py -f exps/customed_example/v++_SwinTiny_example.py -c v++_swinTiny.pth --fp16

Below is my exp file:

v++_SwinTiny_example.txt

Thank you for your reply in advance !!!

@LLF-afk
Copy link
Author

LLF-afk commented Dec 6, 2024

    你用的是json格式,而我用的是npy格式,我没有使用过json格式        

   self.data_dir = "YoloVOD/FIRE_VID/FIRE/"
    self.train_ann = "YoloVOD/FIRE_VID/FIRE/train_video.json"
    self.val_ann = "YoloVOD/FIRE_VID/FIRE/val_video.json"

这是我的
self.data_dir = '/smoke_fusion_theraml/tar_gz'
self.vid_train_path = '/smoke_fusion_theraml/tar_gz/yolox/data/datasets/train_seq.npy'
self.vid_val_path = '/smoke_fusion_theraml/tar_gz/yolox/data/datasets/val_seq.npy'

你可以参考这个,npy文件(在YOLOv代码的主界面中Quick Start中的:Download our COCO-style annotations for training, FGFA version training annotation and video sequences. Then, put them in these two directories: 这段里面的可以下载npy文件):https://drive.google.com/file/d/1vJs8rLl_2oZOWCMJtk3a9ZJmdNn8cu-G/view

The train_seq.npy and val_seq.npy files are numpy arrays of lists. They can be loaded using the following command:
numpy.load('./yolox/data/datasets/train_seq.npy',allow_pickle=True)

@LLF-afk
Copy link
Author

LLF-afk commented Dec 6, 2024

What I want to know is what configuration file you used for training, and I didn't use the json file. If it's convenient for you, you can add me on QQ: 2926968068 Lei Lanfang @.***

------------------ Original Message ------------------ From: "Dilshod Bazarov @.>; Sent: Friday, December 6, 2024, 3:47 PM To: _@**._>; Cc: _@.>; @._>; Subject: Re: [YuHengsss/YOLOV] AttributeError: ' NoneType' #39 ; object has no attribute ' group' #39 ; (Issue #110 ) I got the same error. But my video frames vary between 200 and 300 frames for each video. I am trying to fine-tune YOLOv++ on a single class. Can this error be because of a single class (I think it is not a reason)? Any help or idea is really appreciated. Thank you so much for your reply, but when I got this issue first time, I tried above as you suggested. Unfortunately, it did not work for me. That's why I asked here. I am getting a similar error.... Anyway, below is my dataset: Totally 95 videos, frames range from 200 to 300 for each video and I have single class. I splitted 20 for val set and 75 video sequences into train set. I am stuck into this problem. There is no progress. I also re-prepared my json file structure based on json file in #115 but it did not work. Do you think, guys is there any issue in my dataset? — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: _@_.*>

Usually I do not use QQ. I will try to contact you soon, But quick question? Do you mean exp file by saying configuration file? I am using the below CLI to train:

python tools/vid_train.py -f exps/customed_example/v++_SwinTiny_example.py -c v++_swinTiny.pth --fp16

Below is my exp file:

v++_SwinTiny_example.txt

Thank you for your reply in advance !!!

可以看这个,#110 (comment) 我刚刚进行评论的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants