Error "NotImplementedError: Cannot convert a symbolic Tensor to a numpy array" Is Reported During Model Training

Symptom

During the training of some models, the error message "NotImplementedError: Cannot convert a symbolic Tensor to a numpy array" is displayed. As a result, the model training fails. The following is an example of the error message:

Figure 1 Error message

Possible Causes

The NumPy version is too high to support training of the current model.

Solution

Uninstall NumPy of the current version, install NumPy 1.19.5, and restart the training job.