gradio-app / gradio

Build and share delightful machine learning apps, all in Python. 🌟 Star to support our work!
http://www.gradio.app
Apache License 2.0
32.19k stars 2.41k forks source link

Build error with tf 1.x. #1635

Closed innat closed 2 years ago

innat commented 2 years ago

Describe the bug

I have a model written in tf 1.13. And I tried to publish it in hugging face space with gradio. But I am facing build error with requirements file.

But I am not sure if I write this to here to hugging face but somewhere I read that it's same. Please let me know. Thanks.

Is there an existing issue for this?

Reproduction

My requirements.txt file contains

tensorflow==1.3.0
keras==2.0.8
opencv-python
gradio==3.0.15
gdown==4.4.0

Screenshot

image

It's showing that the expected tf versions are from 2.x to later. Is this expected?

Logs

> --> RUN mkdir app
CACHED

--> RUN git lfs install
CACHED

--> RUN apt-get update && apt-get install -y         ffmpeg         libsm6         libxext6         cmake         libgl1-mesa-glx
CACHED

--> RUN useradd -m -u 1000 user
CACHED

--> RUN pip install         datasets         huggingface-hub
CACHED

--> COPY requirements.txt /home/user/app/requirements.txt
DONE 0.0s

--> RUN pip install -r requirements.txt
Defaulting to user installation because normal site-packages is not writeable
ERROR: Could not find a version that satisfies the requirement tensorflow==1.3.0 (from versions: 2.2.0, 2.2.1, 2.2.2, 2.2.3, 2.3.0, 2.3.1, 2.3.2, 2.3.3, 2.3.4, 2.4.0, 2.4.1, 2.4.2, 2.4.3, 2.4.4, 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.6.0rc0, 2.6.0rc1, 2.6.0rc2, 2.6.0, 2.6.1, 2.6.2, 2.6.3, 2.6.4, 2.6.5, 2.7.0rc0, 2.7.0rc1, 2.7.0, 2.7.1, 2.7.2, 2.7.3, 2.8.0rc0, 2.8.0rc1, 2.8.0, 2.8.1, 2.8.2, 2.9.0rc0, 2.9.0rc1, 2.9.0rc2, 2.9.0, 2.9.1)
ERROR: No matching distribution found for tensorflow==1.3.0
WARNING: You are using pip version 22.0.2; however, version 22.1.2 is available.
You should consider upgrading via the '/usr/local/bin/python -m pip install --upgrade pip' command.

--> ERROR: process "/bin/sh -c pip install -r requirements.txt" did not complete successfully: exit code: 1

System Info

Hugging face space (Gradio).

Severity

annoying

innat commented 2 years ago

(might relevant https://github.com/gradio-app/gradio/issues/64)

abidlabs commented 2 years ago

Hi @innat, this is actually not a Gradio related issue, but the machines on Hugging Faces Spaces run Python 3.8 by default, which doesn't support TF 1.x. You can see here how to change that: https://discuss.huggingface.co/t/support-tf-1-14-or-1-15-plz/14938