Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -11,22 +11,22 @@ from net.dornet import Net
|
|
| 11 |
from net.dornet_ddp import Net_ddp
|
| 12 |
import subprocess
|
| 13 |
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
|
| 31 |
# init
|
| 32 |
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
|
|
|
|
| 11 |
from net.dornet_ddp import Net_ddp
|
| 12 |
import subprocess
|
| 13 |
|
| 14 |
+
def install_mmcv():
|
| 15 |
+
try:
|
| 16 |
+
subprocess.run([
|
| 17 |
+
"pip", "install", "mmcv-full==1.7.2",
|
| 18 |
+
"-f", "https://download.openmmlab.com/mmcv/dist/cu121/torch2.1.0/"
|
| 19 |
+
], check=True)
|
| 20 |
+
except subprocess.CalledProcessError as e:
|
| 21 |
+
print("Failed to install mmcv-full:", e)
|
| 22 |
+
|
| 23 |
+
install_mmcv()
|
| 24 |
+
print("=" * 50)
|
| 25 |
+
print(f"CUDA available: {torch.cuda.is_available()}")
|
| 26 |
+
print(f"torch version: {torch.__version__}")
|
| 27 |
+
print(f"CUDA version: {torch.version.cuda}")
|
| 28 |
+
print(f"mmcv version: {mmcv.__version__}")
|
| 29 |
+
print("=" * 50)
|
| 30 |
|
| 31 |
# init
|
| 32 |
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
|