datasets/cityscapes.py:143 self.centroids = self.fine_centroids might be changed to self.centroids = copy.deepcopy(self.fine_centroids). As I see, self.centroids is a combination of self.fine_centroids and 'coarse_centroids', but if you just use = here, self.fine_centroids would be changed as self.centroids changing in the fowllowing codes: self.centroids[cid].extend(self.coarse_centroids[cid]), which locates at 163 in the same file.
So when disable_coarse() is called, self.centroids is not really changed, because self.fine_centroids is the same as self.centroids.
train.py:442: train_obj.disable_coarse(). In my test, even though we call this function, and it did execute, however, the dataset in DataLoader is not changed. If you print the id(self.imgs) inside function build_epoch() and __getitem__() separately after call disable_coarse(), you will find their id are different, which means self.imgs is changed in build_epoch(), but not used in __getitem__(). Maybe this is because of the implementation of DataLoader.
When epoch > max_cu_epoch, new generated self.imgs should be all come from 'gtFine_trainvaltest', but as these two problems, it won't work.
self.centroids = self.fine_centroids
might be changed toself.centroids = copy.deepcopy(self.fine_centroids)
. As I see,self.centroids
is a combination ofself.fine_centroids
and 'coarse_centroids', but if you just use=
here,self.fine_centroids
would be changed asself.centroids
changing in the fowllowing codes:self.centroids[cid].extend(self.coarse_centroids[cid])
, which locates at 163 in the same file. So whendisable_coarse()
is called,self.centroids
is not really changed, becauseself.fine_centroids
is the same asself.centroids
.train_obj.disable_coarse()
. In my test, even though we call this function, and it did execute, however, thedataset
in DataLoader is not changed. If you print theid(self.imgs)
inside functionbuild_epoch()
and__getitem__()
separately after calldisable_coarse()
, you will find their id are different, which meansself.imgs
is changed inbuild_epoch()
, but not used in__getitem__()
. Maybe this is because of the implementation of DataLoader.epoch > max_cu_epoch
, new generatedself.imgs
should be all come from 'gtFine_trainvaltest', but as these two problems, it won't work.