error infos:
File “/opt/tlt/.cache/dazel/_dazel_tlt/2b81a5aac84a1d3b7a324f2a7a6f400b/execroot/ai_infra/bazel-out/k8-fastbuild/bin/magnet/packages/iva/build_wheel.runfiles/ai_infra/iva/makenet/utils/mixup_generator.py”, line 82, in next
File “/usr/local/lib/python3.6/dist-packages/keras_preprocessing/image/iterator.py”, line 116, in next
return self._get_batches_of_transformed_samples(index_array)
File “/usr/local/lib/python3.6/dist-packages/keras_preprocessing/image/iterator.py”, line 239, in _get_batches_of_transformed_samples
x = self.image_data_generator.standardize(x)
File “/usr/local/lib/python3.6/dist-packages/keras_preprocessing/image/image_data_generator.py”, line 708, in standardize
x = self.preprocessing_function(x)
File “/opt/tlt/.cache/dazel/_dazel_tlt/2b81a5aac84a1d3b7a324f2a7a6f400b/execroot/ai_infra/bazel-out/k8-fastbuild/bin/magnet/packages/iva/build_wheel.runfiles/ai_infra/iva/makenet/utils/preprocess_input.py”, line 246, in preprocess_input
File “/opt/tlt/.cache/dazel/_dazel_tlt/2b81a5aac84a1d3b7a324f2a7a6f400b/execroot/ai_infra/bazel-out/k8-fastbuild/bin/magnet/packages/iva/build_wheel.runfiles/ai_infra/iva/makenet/utils/preprocess_input.py”, line 69, in _preprocess_numpy_input
NotImplementedError: torch mode doesn’t support custom image_mean
image_mean dict ‘b’: 103.939 ‘g’: 116.779 ‘r’: 123.68 A key/value pair to specify image mean values. It’s only applicable when preprocess_mode is caffe . If omitted, ImageNet mean will be used for image preprocessing. If set, depending on output_channel, either ‘r/g/b’ or ‘l’ key/value pair must be configured.
what’s the difference between caffe mode、torch mode?
caffe mode: will convert the images from RGB to BGR, then will zero-center each color channel with respect to the ImageNet dataset, without scaling
torch mode: will scale pixels between 0 and 1 and then will normalize each channel with respect to the ImageNet dataset.
Unfortunately, there is an issue in TLT 3.0. The img_mean is not set correctly before training.
Please use “caffe” instead.
We will fix it in next release.
In the blog, it tells end user how to train a pretrained model with Imagenet dataset. The end user can train a yolo_v3/ssd/faster_rcnn/etc model with this previously trained ImageNet-based model as pretrained weights.
It is actually using TLT classification to train a pretrained model with Imagenet dataset, see the blog, we cannot draw a conclusion that which mode is better. Some spec file does not use torch mode.