Search code examples
tensorflowmachine-learningkerastransfer-learning

KerasNLP and TensorFlow Models repository (TFM) not available via pip


I am interested in prebuild Models and according to the current documentation for Keras (https://keras.io/keras_nlp/) and tensorflow (https://www.tensorflow.org/api_docs/more) there should be pip packages available. But if I try to install them in WSL or in general on linux cli I get errors like

pip3 install tensorflow-models-official install -q --upgrade keras-nlp ERROR: Could not find a version that satisfies the requirement tensorflow-models-official (from versions: none) ERROR: No matching distribution found for tensorflow-models-official

I was expecting that the packages would be found and installed.


Solution

  • What the error says is there is no package named tensorflow-models-official.

    Check the link about install here: https://github.com/tensorflow/models/tree/master/official#how-to-get-started-with-the-official-models

    Ideally the command should be: pip3 install tf-models-official==2.8.0.

    The version may change in future, so replace the version number as per your need or remove it completely to install latest that can be run with your environment as:

    pip3 install tf-models-official.

    Also if the package exist or not check on pypi: https://pypi.org/ and copy the pip command by visiting the package: https://pypi.org/project/tf-models-official/