[Fix]: fix deep copy data list item (#471)

This commit is contained in:
Mashiro 2022-08-25 16:53:32 +08:00 committed by GitHub
parent 8770c6c7fc
commit 5d27504a06
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -264,7 +264,7 @@ class BaseDataset(Dataset):
self.data_bytes[start_addr:end_addr]) # type: ignore
data_info = pickle.loads(bytes) # type: ignore
else:
data_info = self.data_list[idx]
data_info = copy.deepcopy(self.data_list[idx])
# Some codebase needs `sample_idx` of data information. Here we convert
# the idx to a positive number and save it in data information.
if idx >= 0: