Stylique commited on
Commit
e411375
Β·
verified Β·
1 Parent(s): a79e851

Upload post_install.py

Browse files
Files changed (1) hide show
  1. post_install.py +25 -14
post_install.py CHANGED
@@ -71,22 +71,20 @@ def install_torch_sparse():
71
 
72
  if pytorch_base.startswith("2.7"):
73
  print("PyTorch 2.7.x detected - this is very recent and may not have compatible wheels")
74
- print("Downgrading to PyTorch 2.0.1+cu117 for better compatibility...")
75
 
76
- # Uninstall current PyTorch
77
- print("Uninstalling current PyTorch...")
78
- run_command("pip uninstall torch torchvision torchaudio -y")
 
 
 
 
79
 
80
- # Install compatible PyTorch version
81
- print("Installing PyTorch 2.0.1+cu117...")
82
- if run_command("pip install torch==2.0.1 torchvision==0.15.2 torchaudio==2.0.2 --index-url https://download.pytorch.org/whl/cu117"):
83
- PYTORCH_VERSION = "2.0.1"
84
- CUDA_VERSION = "cu117"
85
- print("Successfully installed PyTorch 2.0.1+cu117")
86
- else:
87
- print("Failed to install PyTorch 2.0.1+cu117, keeping current version")
88
- PYTORCH_VERSION = pytorch_base
89
- CUDA_VERSION = cuda_version
90
  else:
91
  # Store version info for later use
92
  PYTORCH_VERSION = pytorch_base
@@ -515,6 +513,17 @@ def main():
515
  print("βœ— torch-sparse (not available)")
516
  except:
517
  print("βœ— torch-sparse (not available)")
 
 
 
 
 
 
 
 
 
 
 
518
 
519
  # Check if torch-scatter is available
520
  try:
@@ -522,6 +531,8 @@ def main():
522
  print("βœ“ torch-scatter")
523
  except ImportError:
524
  print("⚠ torch-scatter (not available, may not be critical)")
 
 
525
 
526
  import nvdiffrast
527
  print("βœ“ nvdiffrast")
 
71
 
72
  if pytorch_base.startswith("2.7"):
73
  print("PyTorch 2.7.x detected - this is very recent and may not have compatible wheels")
74
+ print("Attempting to work with current PyTorch version and disable problematic extensions...")
75
 
76
+ # Keep current PyTorch version but disable torch-sparse and torch-scatter
77
+ PYTORCH_VERSION = pytorch_base
78
+ CUDA_VERSION = cuda_version
79
+
80
+ # Force disable torch-sparse and torch-scatter since they have ABI issues
81
+ print("Disabling torch-sparse and torch-scatter due to ABI compatibility issues...")
82
+ disable_torch_sparse()
83
 
84
+ # Install torchvision for current PyTorch version
85
+ print("Installing torchvision for current PyTorch version...")
86
+ if not run_command("pip install torchvision"):
87
+ print("Warning: Failed to install torchvision")
 
 
 
 
 
 
88
  else:
89
  # Store version info for later use
90
  PYTORCH_VERSION = pytorch_base
 
513
  print("βœ— torch-sparse (not available)")
514
  except:
515
  print("βœ— torch-sparse (not available)")
516
+ except Exception as e:
517
+ # Check if torch-sparse was disabled due to ABI issues
518
+ try:
519
+ with open("NeuralJacobianFields/PoissonSystem.py", 'r') as f:
520
+ content = f.read()
521
+ if "USE_TORCH_SPARSE = False" in content:
522
+ print("βœ“ torch-sparse (disabled due to ABI issues, using built-in PyTorch sparse)")
523
+ else:
524
+ print(f"βœ— torch-sparse import failed: {e}")
525
+ except:
526
+ print(f"βœ— torch-sparse import failed: {e}")
527
 
528
  # Check if torch-scatter is available
529
  try:
 
531
  print("βœ“ torch-scatter")
532
  except ImportError:
533
  print("⚠ torch-scatter (not available, may not be critical)")
534
+ except Exception as e:
535
+ print(f"⚠ torch-scatter import failed: {e} (may not be critical)")
536
 
537
  import nvdiffrast
538
  print("βœ“ nvdiffrast")