[Fix] Fix inputs dtype convert in data preprocessor (#1975)

pull/1977/head
Miao Zheng 2022-08-26 17:25:48 +08:00 committed by GitHub
parent 8de0050f25
commit ef2152fd54
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -104,10 +104,9 @@ class SegDataPreProcessor(BaseDataPreprocessor):
if self.channel_conversion and inputs[0].size(0) == 3:
inputs = [_input[[2, 1, 0], ...] for _input in inputs]
inputs = [_input.float() for _input in inputs]
if self._enable_normalize:
inputs = [(_input - self.mean) / self.std for _input in inputs]
else:
inputs = [_input.float() for _input in inputs]
if training:
assert data_samples is not None, ('During training, ',