keras-team / keras

Deep Learning for humans
http://keras.io/
Apache License 2.0
61.06k stars 19.35k forks source link

No module named 'keras.src.engine' #19677

Open UmerElsaharty opened 1 week ago

UmerElsaharty commented 1 week ago

i got the error in the title while importing libraries for training my Vit model , i tried to install vit_keras , tensorflow_addons , keras-nightly and made sure that the KERAS_BACKEND environment variable is set to "tensorflow". and still shows up i train my model on kaggle .

sachinprasadhs commented 1 week ago

@UmerElsaharty , Could you please provide the reproducible code.

vit_keras is not released by Keras team, you can probably reach out to the author mentioned in the PyPi page of package.

UmerElsaharty commented 1 week ago

sure here is the code :

https://github.com/xRedik/Master_Thesis/blob/main/code/model/VIT/VIT_model.ipynb

it's running well on colab , i dont know why this happened on kaggle

sachinprasadhs commented 1 week ago

Could you please upgrade the Keras version using pip install -U keras and use the keras import directly as import keras, which uses latest Keras.

UmerElsaharty commented 1 week ago

the error is still there , a message has been shown to me saying that the pip cant install some components of the packages can this has a relation with the error ? and here is the message: "ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. ydata-profiling 4.6.4 requires numpy<1.26,>=1.16.0, but you have numpy 1.26.4 which is incompatible. ydata-profiling 4.6.4 requires typeguard<5,>=4.1.2, but you have typeguard 2.13.3 which is incompatible."

sachinprasadhs commented 1 week ago

You need to maually resolve those version conflict dependency, but I don't think the error is due to Keras, check with vit_keras, which we are not releasing.

UmerElsaharty commented 1 week ago

i think the issue is with kaggle itself because the code is running so well on google colab , could you please tell me recommendation of how to check with vit_keras !

sachinprasadhs commented 1 week ago

You can contact author mentioned in the page here https://pypi.org/project/keras-vit/ and close thew issue here. Thanks!