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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

could not find the files in MMengine which are removed in MMCV_v2x parallel. example, for DataContainer #2934

Open
cr7Alex opened this issue Sep 15, 2023 · 6 comments

Comments

@cr7Alex
Copy link

cr7Alex commented Sep 15, 2023

馃摎 The doc issue

I was trying to update the version from mmcv 1x to 2x . Some files are removed. For example, https://github.com/open-mmlab/mmcv/tree/v1.7.1/mmcv/parallel. which is removed in mmcv 2x and mentioned to use mmengine, but for my project I did not find the data_container.py and collate.py etc in mmengine, so please someone help me to find all those files.

Suggest a potential alternative/fix

No response

@fanqiNO1
Copy link
Collaborator

For DataContainer, mmengine.BaseDataElement has the similar function.
https://github.com/open-mmlab/mmengine/blob/53474ef1ba0b166508c231fa525b55b580adf20f/mmengine/structures/base_data_element.py#L9

For collate.py, you can find the function collate at mmengine.dataset.utils.
https://github.com/open-mmlab/mmengine/blob/main/mmengine/dataset/utils.py

@cr7Alex
Copy link
Author

cr7Alex commented Sep 25, 2023

Thank you @fanqiNO1 when I tried BaseDataElement incident of Data container and I am unable to iter the Data loader . Does collate function is replaced with another function name ?? please help me to find

error:
results_img_list.append(BaseDataElement(to_tensor(img),
TypeError: init() takes 1 positional argument but 2 were given

@fanqiNO1
Copy link
Collaborator

Sorry, there is no other function which replace the collate function.

However, you can refer https://github.com/open-mmlab/mmengine/blob/3b639da1ef3b46d5a42c94e3253d251d5bb6abf1/mmengine/structures/base_data_element.py#L81 to change results_img_list.append(BaseDataElement(to_tensor(img), to results_img_list.append(BaseDataElement(img=to_tensor(img),

@ajayrafa25
Copy link

Sep 20, 2023

@fanqiNO1 Could you please explain why DataContainer has been replaced with BaseDataElement

@fanqiNO1
Copy link
Collaborator

fanqiNO1 commented Nov 20, 2023

In order to provide downstream algorithm libraries with a unified abstract data structure for data transfer between components and they need to support the wrapping of data of various natures and sizes, the DataContainer was changed to BaseDataElement.

@penchalredd
Copy link

earlier there was a stacking feature in the data container but in basedataelement, i didn't see this feature.
@fanqiNO1 please help me with stacking feature in the latest mmengine with base data element

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