Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

None of PyTorch, TensorFlow >= 2.0, or Flax have been found. Models won't be available and only tokenizers, configuration and file/data utilities can be used. #11688

Closed
5 tasks done
bscz opened this issue Dec 16, 2024 · 2 comments
Labels
🐞 bug Something isn't working 🤔 cant-reproduce We can not reproduce it or the information is limited

Comments

@bscz
Copy link

bscz commented Dec 16, 2024

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.13.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

docker ps -a
image

exception1 None of PyTorch, TensorFlow >= 2.0, or Flax have been found.
image

exception2 502 Bad Gateway
image

✔️ Expected Behavior

No response

❌ Actual Behavior

Running migrations
None of PyTorch, TensorFlow >= 2.0, or Flax have been found. Models won't be available and only tokenizers, configuration and file/data utilities can be used.
2024-12-16 07:22:18.710 INFO [MainThread] [utils.py:148] - Note: NumExpr detected 64 cores but "NUMEXPR_MAX_THREADS" not set, so enforcing safe limit of 8.
2024-12-16 07:22:18.711 INFO [MainThread] [utils.py:160] - NumExpr defaulting to 8 threads.
[FATAL:partition_root.cc(863)] Check failed: (internal::SystemPageSize() == (size_t{1} << 12)) || (internal::SystemPageSize() == (size_t{1} << 14)).
/entrypoint.sh: line 8: 7 Trace/breakpoint trap (core dumped) flask upgrade-db

@dosubot dosubot bot added 🐞 bug Something isn't working 🤔 cant-reproduce We can not reproduce it or the information is limited labels Dec 16, 2024
Copy link

dosubot bot commented Dec 16, 2024

Hey @bscz! I'm here to help you with any bugs, questions, or contributions you have for the project. Let's work together to get this sorted out!

I found a similar open issue regarding the error message "None of PyTorch, TensorFlow >= 2.0, or Flax have been found" in a Dify self-hosted environment. The suggested solution involves modifying the Dockerfile or Docker Compose setup to ensure these libraries are installed. Here are the steps you can follow:

  1. Dockerfile Adjustments: Add installation commands for PyTorch, TensorFlow, and Flax in your Dockerfile. For example:

    FROM python:3.8
    # Set up your environment and install other dependencies
    RUN pip install torch==1.8.1 tensorflow>=2.0 flax
    # Continue with the rest of your Dockerfile setup
  2. Requirements File: If your project uses a requirements.txt file, add PyTorch, TensorFlow, and Flax to this file:

    torch==1.8.1
    tensorflow>=2.0
    flax
    
  3. Docker Compose: Ensure the service responsible for the migration has access to an environment where these libraries are installed. This might involve building a custom image with these dependencies included.

  4. Environment Variables: Ensure any necessary environment variables or configurations for these libraries are correctly set in your Docker environment.

  5. Volume Mounts: If your models are stored outside the Docker container, use Docker volumes to mount the model directory inside the container.

After making these changes, rebuild your Docker images and run the containers to ensure the issue is resolved [1].

Regarding the 502 Bad Gateway error, it is commonly caused by Nginx forwarding requests to the wrong location. Ensure that the target containers are running and update the Nginx configuration with the correct IP addresses of the containers. You can follow these steps:

  1. Verify that the relevant containers are running:

    docker ps -q | xargs -n 1 docker inspect --format '{{ .Name }}: {{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}'
  2. Identify the IP addresses for the /docker-web-1 and /docker-api-1 containers.

  3. Update the Nginx configuration in the dify/docker/nginx/conf.d directory:

    • Replace http://api:5001 with http://<api-container-ip>:5001
    • Replace http://web:3000 with http://<web-container-ip>:3000
  4. Restart the Nginx container or reload the configuration to apply the changes [2].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

@crazywoola
Copy link
Member

Please upgrade to v0.13.2 or v0.14.0. It might take some time to start the container when you migrating from older versions. This is a warning message as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working 🤔 cant-reproduce We can not reproduce it or the information is limited
Projects
None yet
Development

No branches or pull requests

2 participants