ShalomKing commited on
Commit
4eab2ed
·
verified ·
1 Parent(s): 9e715f7

Fix torchvision NMS registration on ZeroGPU

Browse files
Files changed (2) hide show
  1. Dockerfile +2 -1
  2. app.py +3 -0
Dockerfile CHANGED
@@ -3,7 +3,8 @@ FROM nvidia/cuda:12.1.0-devel-ubuntu22.04
3
  # Set environment variables
4
  ENV DEBIAN_FRONTEND=noninteractive \
5
  PYTHONUNBUFFERED=1 \
6
- PYTHON_VERSION=3.10
 
7
 
8
  # Install system dependencies
9
  RUN apt-get update && apt-get install -y \
 
3
  # Set environment variables
4
  ENV DEBIAN_FRONTEND=noninteractive \
5
  PYTHONUNBUFFERED=1 \
6
+ PYTHON_VERSION=3.10 \
7
+ TORCHVISION_DISABLE_META_REGISTRATIONS=1
8
 
9
  # Install system dependencies
10
  RUN apt-get update && apt-get install -y \
app.py CHANGED
@@ -10,6 +10,9 @@ import logging
10
  import warnings
11
  from pathlib import Path
12
 
 
 
 
13
  import gradio as gr
14
  import torch
15
  import numpy as np
 
10
  import warnings
11
  from pathlib import Path
12
 
13
+ # Prevent torchvision from registering optional CUDA/Meta ops (nms) that may be missing on ZeroGPU
14
+ os.environ.setdefault("TORCHVISION_DISABLE_META_REGISTRATIONS", "1")
15
+
16
  import gradio as gr
17
  import torch
18
  import numpy as np