Open ayushsharma-1 opened 1 week ago
Hi @ayushsharma-1 ,
Thank you for reporting the issue. As far as I know, the tfjs-converter
doesn't require NumPy to convert .h5 models. However, it's possible that your model was created with a Keras
that used NumPy 1.20 or higher
. To investigate further, please share your .h5
model file.
Thank You!!
tensorflowjs_wizard
2024-11-21 08:48:25.489059: I tensorflow/core/util/port.cc:153] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable TF_ENABLE_ONEDNN_OPTS=0
.
2024-11-21 08:48:25.501613: E external/local_xla/xla/stream_executor/cuda/cuda_fft.cc:477] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
E0000 00:00:1732175305.516847 4053563 cuda_dnn.cc:8310] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered
E0000 00:00:1732175305.521461 4053563 cuda_blas.cc:1418] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered
2024-11-21 08:48:25.536675: I tensorflow/core/platform/cpu_feature_guard.cc:210] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX512F AVX512_VNNI AVX512_BF16 AVX512_FP16 AVX_VNNI AMX_TILE AMX_INT8 AMX_BF16 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
/site-packages/tensorflowjs/read_weights.py:28: FutureWarning: In the future np.object
will be defined as the corresponding NumPy scalar.
np.uint8, np.uint16, np.object, np.bool]
Traceback (most recent call last):
File "/bin/tensorflowjs_wizard", line 5, in np.object
was a deprecated alias for the builtin object
. To avoid this error in existing code, use object
by itself. Doing this will not modify any behavior and is safe.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations. Did you mean: 'object'?
For me, it happens directly when I invoke the wizard.
For me, changing to the newest tfjs already resolved the problem. As they already fixed it in the source. They replaced np.object with object.
@ayushsharma-1 ,If you're still encountering the issue after upgrading tfjs, please share your .h5
model for further investigation. Thank You!!
1. URL of the file using: https://github.com/tensorflow/tfjs
2. Issue: I am encountering an issue when attempting to convert a Keras model (
.h5
) to TensorFlow.js format using thetensorflowjs_converter
command. The issue arises due to the deprecated usage ofnp.object
in the TensorFlow.js code.Starting from NumPy 1.20, the
np.object
alias has been removed, causing compatibility issues with newer versions of NumPy. When I try running thetensorflowjs_converter
tool, I receive the following error:This error occurs because
np.object
was removed as part of the NumPy 1.20 update, and is now considered a deprecated alias for the built-inobject
. The solution to this issue would be to replace the usage ofnp.object
in TensorFlow.js with the standardobject
type, which is the correct usage in newer versions of NumPy.Steps to Reproduce:
.h5
model to TensorFlow.js format using the command:3. Additional context:
np.object
is no longer supported in NumPy versions 1.20 and later. The official NumPy documentation notes thatnp.object
was deprecated and removed in version 1.20.4. Are you willing to contribute it? (Yes or No): No