Was ist der Fehler „ImportError: numpy.core.multiarray konnte nicht importiert werden“?
Posted: 07 Jan 2025, 13:51
Ich habe an einem Projekt gearbeitet, das Numpy benötigte. Ich habe pip install numpy verwendet und die Meldung erhalten, dass es bereits installiert ist. Nachdem ich diesen Code fertiggestellt habe und einen anderen Code ausgeführt habe, erhalte ich die folgende Fehlermeldung, die vorher nicht aufgetreten ist. Ich verwende Python 3.6. Gleiche Versionen vor und nach dem Problem.
Client-Code:
Ich erhalte die folgende Fehlermeldung:
Ich habe sowohl TF als auch Numpy deinstalliert und zurückgesetzt. Immer noch der gleiche Fehler.
Irgendwelche Hilfe?
Danke,
Pubudu
Client-Code:
Code: Select all
import requests
#import json
from keras.preprocessing.image import img_to_array, array_to_img, load_img
from keras.preprocessing import image
flowers = 'c:/flower_photos/daisy/107592979_aaa9cdfe78_m.jpg'
#for x in flowers:
image1 = img_to_array(image.load_img(flowers, target_size=(128,128))) / 255
payload = {
"instances": [{"image":image1.tolist()},
]
}
print("sending request...")
r = requests.post('http://localhost:8501/v1/models/flowers/versions/1:predict', json=payload)
#r = requests.get('http://localhost:8051/v1/models/modelflowers/versions/1/metadata')
print(r.content)
Code: Select all
C:\flowers_old>client.py
Using TensorFlow backend.
ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'
ImportError: numpy.core.multiarray failed to import
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "", line 980, in _find_and_load
SystemError: returned a result with an error set
ImportError: numpy.core._multiarray_umath failed to import
ImportError: numpy.core.umath failed to import
2019-02-10 19:15:06.355011: F tensorflow/python/lib/core/bfloat16.cc:675] Check failed: PyBfloat16_Type.tp_base != nullptr
Irgendwelche Hilfe?
Danke,
Pubudu