Skip to content

Commit

Permalink
fixing torch version?
Browse files Browse the repository at this point in the history
  • Loading branch information
carsen-stringer committed Feb 12, 2024
1 parent 4f0c43e commit 307a70f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion cellpose/gui/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,13 +248,15 @@ def _load_seg(parent, filename=None, image=None, image_file=None):
found_image = True
if found_image:
try:
print(parent.filename)
image = imread(parent.filename)
except:
parent.loaded = False
found_image = False
print('ERROR: cannot find image file, loading from npy')
if not found_image:
parent.filename = filename[:-11]
parent.filename = filename[:-8]
print(parent.filename)
if 'img' in dat:
image = dat['img']
else:
Expand Down
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@
try:
import torch
a = torch.ones(2, 3)
major_version, minor_version, _ = torch.__version__.split(".")
from importlib.metadata import version
ver = version("torch")
major_version, minor_version, _ = ver.split(".")
if major_version == "2" or int(minor_version) >= 6:
install_deps.remove("torch>=1.6")
except:
Expand Down

0 comments on commit 307a70f

Please sign in to comment.