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

TypeError: can't pickle _thread.RLock objects #1

Closed
kelek2 opened this issue Oct 22, 2021 · 6 comments
Closed

TypeError: can't pickle _thread.RLock objects #1

kelek2 opened this issue Oct 22, 2021 · 6 comments

Comments

@kelek2
Copy link

kelek2 commented Oct 22, 2021

Hi:
when we use your tool img_split.py, meet the error TypeError: can't pickle _thread.RLock objects,
happens " patch_infos = pool.map(worker, zip(infos, img_dirs))" , looks like multiprocessing problem , can you suggest us how to solve the problem, thanks

@jbwang1997
Copy link
Owner

I haven't met this error in my python 3.7.3. I recommend you updating the vision of python or using one processing by setting --nproc 1.

@kelek2
Copy link
Author

kelek2 commented Oct 23, 2021

Thank you for your reply, and I would like to ask again. When using FASTER RCNN OBB to train the DOTA dataset, first I want to use the img_split.py tool to cut the image, and whether the input dota txt annotation data format is (x1, x2, y1, y2, x3 ,y3,x4,y4,lable,diff)

@jbwang1997
Copy link
Owner

Yes. img_split.py can directly load DOTA annotations by setting --load_type dota. There are also other annotation formats for different datasets.

@kelek2
Copy link
Author

kelek2 commented Oct 25, 2021

Thanks, I use img_split.py split the image and make the annotation files, but when we use FASTER RCNN OBB method train the splited DOTA dataset, run tools/train.py ,
we meet the problem "ValueError: operands could not be broadcast together with shapes (3,8) (4,) ",
where it happed in the "mmdet/datasdets/pipelines/transforms.py",
function" def _resize_bboxes(self, results):
"""Resize bounding boxes with results['scale_factor']."""
img_shape = results['img_shape']
for key in results.get('bbox_fields', []):
bboxes = results[key] * results['scale_factor']
bboxes[:, 0::2] = np.clip(bboxes[:, 0::2], 0, img_shape[1])
bboxes[:, 1::2] = np.clip(bboxes[:, 1::2], 0, img_shape[0])
results[key] = bboxes"
we think it the train image or annotations format problem, can u give us a brief introdaction how to make the data format to train the DOTA datesets using the FASTER RCNN OBB, the config file is "configs/obb/faster_rcnn_obb/faster_rcnn_obb_r50_fpn_1x_dota10.py", thanks!

@jbwang1997
Copy link
Owner

Sorry, this is the first time I meet this error, You can check oriented_model_starting for details of using OBBDtection.

@XuJieLing-cloud
Copy link

@kelek2 have you solved your problem? i am confused , too

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

3 participants