ValueError: invalid literal for int() with base 10: 'rdered/img_52'

I made some changes in the names of moving and fixed images, like I replaced fi with si, mi with ki, fl with si, ml with kl and then got this error, the further detail is
File “/home/ubuntu/Anwar/XMorpher_reproduce/”, line 142, in
RSTNet = ASeg(OASIS_img_dir, OASIS_seg_dir, LPBA40_img_dir, LPBA40_seg_dir, resized_shape=(80, 96, 112), n_channels=1, lr=1e-4, batch_size=1, data_random_seed=None, model_name=‘XMorpher’)
File “/home/ubuntu/Anwar/XMorpher_reproduce/”, line 33, in init
self.train_OASIS = torch_Dataloader_OASIS(OASIS_img_dir, OASIS_seg_dir, ‘train’, resized_shape, batch_size, data_random_seed)
File “/home/ubuntu/Anwar/XMorpher_reproduce/utilss/”, line 56, in torch_Dataloader_OASIS
Dataset_OASIS = torch_Dataset_OASIS(img_dir, seg_dir, mode, resized_shape)
File “/home/ubuntu/Anwar/XMorpher_reproduce/utilss/”, line 12, in init
self.img.sort(key=lambda x: int(x[43:-7]))
File “/home/ubuntu/Anwar/XMorpher_reproduce/utilss/”, line 12, in
self.img.sort(key=lambda x: int(x[43:-7]))

I don’t know how to understand this change, but the error is raised in int(x[43:-7]) as it seems you are passing a string to it:

x = 'rdered/img_52'
# ValueError: invalid literal for int() with base 10: 'rdered/img_52'

so you might need to index the string in another way assuming you want to transform the 52 to an integer value e.g. via int(x[-2:]).

@ptrblck I try and then reply