DeepLearningExamples icon indicating copy to clipboard operation
DeepLearningExamples copied to clipboard

[DLRM/TensorFlow2] Minor: transcode.py complains about deprecated np.bool type

Open psharpe99 opened this issue 2 years ago • 0 comments

Related to DLRM/TensorFlow2

Describe the bug A minor bug: running the transcode.py as per the README generates a deprecation warning from python.

To Reproduce

root@biber:/home/psharpe/DeepLearningExamples-master/TensorFlow2/Recommendation/DLRM# export DATASET_PARENT_DIRECTORY=pwd

root@biber:/home/psharpe/DeepLearningExamples-master/TensorFlow2/Recommendation/DLRM# echo $DATASET_PARENT_DIRECTORY /home/psharpe/DeepLearningExamples-master/TensorFlow2/Recommendation/DLRM

root@biber:/home/psharpe/DeepLearningExamples-master/TensorFlow2/Recommendation/DLRM# docker run --cap-add SYS_NICE --runtime=nvidia -it --rm --ipc=host -v ${DATASET_PARENT_DIRECTORY}/data:/data nvidia_dlrm_tf bash

root@7cf568793223:/dlrm# python gen_csv.py --feature_spec_in tests/transcoding/small_csv.yaml

root@7cf568793223:/dlrm# mkdir /data/conversion_output

root@7cf568793223:/dlrm# cp tests/transcoding/small_csv.yaml /data/feature_spec.yaml

root@7cf568793223:/dlrm# python transcode.py --input /data --output /data/converted transcode.py:119: DeprecationWarning: np.bool is a deprecated alias for the builtin bool. To silence this warning, use bool by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use np.bool_ here. Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations label_f.write(label_df.values.astype(np.bool).tobytes())

Expected behavior The use of np.bool should be replaced as suggested by the warning, so as to not generate the warning.

Environment Container version as built from the README: root@7cf568793223:/dlrm# cat /etc/os-release NAME="Ubuntu" VERSION="20.04.4 LTS (Focal Fossa)"

root@7cf568793223:/dlrm# python --version Python 3.8.10

psharpe99 avatar Jun 26 '23 10:06 psharpe99