AttributeError: Can't pickle local object 'main.<locals>.ConvertToMultiChannelBasedOnMartianClassesd' #7795
Harris91-lee
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi everyone, Hi @KumoLiu :)
Hope you are doing well?
For the first time im getting such issue (i didn't face that before) where it happens just before the training starts here :
for batch_data in train_loader:
step_start = time.time()
step += 1
inputs, labels = ( %% >> crushes here<<
batch_data["image"].to(device),
batch_data["label"].to(device),
)
the error comes as " AttributeError: Can't pickle local object 'main..ConvertToMultiChannelBasedOnMartianClassesd'"
where ConvertToMultiChannelBasedOnMartianClassesd is looking like this:
class ConvertToMultiChannelBasedOnMartianClassesd(MapTransform):
def call(self, data):
d = dict(data)
# d_ = dict(data)
for key in self.keys:
result = []
i wonder why this issue appears and how to solve it?
Beta Was this translation helpful? Give feedback.
All reactions