Skip to content

Commit

Permalink
fixing bug with save_server (MouseLand#467) and adding docs for cuda …
Browse files Browse the repository at this point in the history
…toolkit 10
  • Loading branch information
carsen-stringer committed Apr 6, 2022
1 parent 2e05d45 commit 196278e
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ You can also try to install cellpose, omnipose and the GUI dependencies from you
python -m pip install cellpose[all]
~~~~


If you have **issues** with installation, see the [docs](https://cellpose.readthedocs.io/en/latest/installation.html) for more details. You can also use the cellpose environment file included in the repository and create a cellpose environment with `conda env create -f environment.yml` which may solve certain dependency issues.

If these suggestions fail, open an issue.
Expand All @@ -131,10 +130,10 @@ Before installing the GPU version, remove the CPU version:
pip uninstall torch
~~~

Follow the instructions [here](https://pytorch.org/get-started/locally/) to determine what version to install. The Anaconda install is strongly recommended, and then choose the CUDA version that is supported by your GPU (newer GPUs may need newer CUDA versions > 10.2). For instance this command will install the 10.2 version on Linux and Windows (note the `torchvision` and `torchaudio` commands are removed because cellpose doesn't require them):
Follow the instructions [here](https://pytorch.org/get-started/locally/) to determine what version to install. The Anaconda install is strongly recommended, and then choose the CUDA version that is supported by your GPU (newer GPUs may need newer CUDA versions > 10.2). For instance this command will install the 11.3 version on Linux and Windows (note the `torchvision` and `torchaudio` commands are removed because cellpose doesn't require them):

~~~
conda install pytorch cudatoolkit=10.2 -c pytorch
conda install pytorch cudatoolkit=11.3 -c pytorch
~~~~

### Installation of github version
Expand Down
7 changes: 4 additions & 3 deletions cellpose/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

try:
from PyQt5 import QtGui, QtCore, Qt, QtWidgets
from PyQt5.QtWidgets import QMessageBox
GUI = True
except:
GUI = False
Expand Down Expand Up @@ -480,13 +481,13 @@ def save_server(parent=None, filename=None):
if no GUI, send this file to server
"""
if parent is not None:
q = QtGui.QMessageBox.question(
q = QMessageBox.question(
parent,
"Send to server",
"Are you sure? Only send complete and fully manually segmented data.\n (do not send partially automated segmentations)",
QtGui.QMessageBox.Yes | QtGui.QMessageBox.No
QMessageBox.Yes | QMessageBox.No
)
if q != QtGui.QMessageBox.Yes:
if q != QMessageBox.Yes:
return
else:
filename = parent.filename
Expand Down
2 changes: 1 addition & 1 deletion cellpose/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def eval(self, x, batch_size=8, channels=None, channel_axis=None, z_axis=None,
invert image pixel intensity before running network (if True, image is also normalized)
normalize: bool (optional, default True)
normalize data so 0.0=1st percentile and 1.0=99th percentile of image intensities in each channel
normalize data so 0.0=1st percentile and 1.0=99th percentile of image intensities in each channel
diameter: float (optional, default 30.)
if set to None, then diameter is automatically estimated if size model is loaded
Expand Down
9 changes: 9 additions & 0 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@ this code at the beginning of your notebook before you import cellpose:
Common issues
~~~~~~~~~~~~~~~~~~~~~~~

If you are having issues with CUDA on Windows, or want to use
Cuda Toolkit 10, please follow these `instructions <https://github.com/MouseLand/cellpose/issues/481#issuecomment-1080137885>`_:

::
conda create -n cellpose pytorch=1.8.2 cudatoolkit=10.2 -c pytorch-lts
conda activate cellpose
pip install cellpose

If you receive the error: ``No module named PyQt5.sip``, then try
uninstalling and reinstalling pyqt5

Expand Down

0 comments on commit 196278e

Please sign in to comment.