English | 简体中文
- Clone this repository to any location you like, and download the pre-trained model.
- Use
condato create a suitable Python virtual environmentccdeep. If you don't mind polluting the system environment, you can also omit this step and use the system Python environment directly. See the following detailed installation tutorial for how to create a virtual environment. - Activate the virtual environment just created and install some dependent packages:
pip install requirements.txt,Some of the dependent packages may not be installed successfully through this command, and detailed solutions are given below. If this command fails to execute, please executepip install packageorconda install packagesone by one in order . - Enter the
ccdeepdirectory in the source code you just download, there have amain.pyfile, you can run this file without providing any parameters, which will tell you how to use this package. Or you can download some sample images to actually execute it, To download the smaple images, please click here.After downloading the sample images to the appropriate place, you can executepython main.py -bf [your example_of_dic.tif path] -pcna [your example_of_mcy.tif path] -o [your output file savepath],Or runpython ./main.py -bf ../examples/images/example_of_dic.tif -pcna ../examples/images/example_of_mcy.tifdirectly in the directory wheremain.pyis located. Not surprisingly, you can get the final single frame prediction output later. You can choose to load it into via for visual viewing, or later convert to zip file and import to ImageJfor viewing. - For more information, please see the usage example
Clone source code from the repository to any you like location:https://github.com/frozenleaves/CCDeep.git
-
If your computer don't install anaconda3, please download and install from here, according to your computer system, choose the appropriate version to install.
-
After installed anaconda3,if you using Windows system,please open the
Anaconda Powershell Prompt(You can find it from the start menu bar),If your system is Linux system or MAC system, please add Anaconda to the environment variable when installing it, and then directly open the terminal. If you do not add the environment variable, you need to add it manually. -
Using
conda create -n CCDeep python=3.7to create a new conda virtual environment, and usingconda activate CCDeepto activate and use this environment. -
If your computer has NVIDIA GPU and you want to speed up the running through GPU,please follow step3 to install
tensorflow-GPU,and correspondingcudatoolkiitandcudnn. If you don't need to use GPU or there is no NVIDIA GPU on your computer, just install thetensorflowCPU version. -
Please install the dependent packages in the following command:
pip install tensorflow==2.4.0(If you install the GPU version,please following the step3 to install the corresponding packages,and then install other packages below)pip install stardist==0.8.3pip install opencv-pythonpip install scikit-imagepip install matplotlibpip install tifffilepip install pylibtiff(If an error occur during installation or after installation, please download the wheel file for offline installation,you can download the wheel file from here, just select the appropriate version to download.)pip install bitarraypip install trackpypip install pandas
If you need to perform this step, please ensure that your virtual environment is clean, and there is no numpy or numpy dependent package installed, otherwise package dependency may occur! If your python version > 3.7, the tensorflow may not complete the high python version, you need to lower your python,or adapt the tensorflow and cuda by yourself.
-
Install
cudatoolkit:conda install cudatoolkit==11.0.221 -
Install
cudnn:conda install cudnn==8.0.5.39 -c conda-forgeNote: these two packages must be installed with
conda install packagecommand, because this are notPython packagesand cannot be indexed in PyPi. -
Install
tensorflow-gpu:pip install tensorflow-gpu==2.4.0。Note:Please do not use
conda install packagecommand to install this package,because thecondasource is not updated to the appropriate version in time, which may prompt the problem that the source cannot be found. -
Test the availability and compatibility of
CUDA:>>> import tensorflow as tf 2022-07-02 13:07:50.756143: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcudart.so.11.0 >>> tf.test.is_gpu_available() 2022-07-02 13:08:20.525184: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcuda.so.1 2022-07-02 13:08:21.247969: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1720] Found device 0 with properties: pciBusID: 0000:18:00.0 name: NVIDIA GeForce RTX 3090 computeCapability: 8.6 coreClock: 1.695GHz coreCount: 82 deviceMemorySize: 23.70GiB deviceMemoryBandwidth: 871.81GiB/s 2022-07-02 13:08:21.248438: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1720] Found device 1 with properties: pciBusID: 0000:3b:00.0 name: NVIDIA GeForce RTX 3090 computeCapability: 8.6 coreClock: 1.695GHz coreCount: 82 deviceMemorySize: 23.70GiB deviceMemoryBandwidth: 871.81GiB/s 2022-07-02 13:08:21.248838: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1720] Found device 2 with properties: pciBusID: 0000:86:00.0 name: NVIDIA GeForce RTX 3090 computeCapability: 8.6 coreClock: 1.695GHz coreCount: 82 deviceMemorySize: 23.70GiB deviceMemoryBandwidth: 871.81GiB/s 2022-07-02 13:08:21.249213: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1720] Found device 3 with properties: pciBusID: 0000:af:00.0 name: NVIDIA GeForce RTX 3090 computeCapability: 8.6 coreClock: 1.695GHz coreCount: 82 deviceMemorySize: 23.70GiB deviceMemoryBandwidth: 871.81GiB/s 2022-07-02 13:08:21.249257: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcudart.so.11.0 2022-07-02 13:08:21.276669: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcublas.so.11 2022-07-02 13:08:21.276817: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcublasLt.so.11 2022-07-02 13:08:21.292073: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcufft.so.10 2022-07-02 13:08:21.299397: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcurand.so.10 2022-07-02 13:08:21.323907: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcusolver.so.10 2022-07-02 13:08:21.329281: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcusparse.so.11 2022-07-02 13:08:21.331335: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcudnn.so.8 2022-07-02 13:08:21.333955: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1862] Adding visible gpu devices: 0, 1, 2, 3 2022-07-02 13:08:21.336478: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcudart.so.11.0 2022-07-02 13:08:25.106753: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1261] Device interconnect StreamExecutor with strength 1 edge matrix: 2022-07-02 13:08:25.106830: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1267] 0 1 2 3 2022-07-02 13:08:25.106849: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1280] 0: N N N N 2022-07-02 13:08:25.106862: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1280] 1: N N N N 2022-07-02 13:08:25.106875: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1280] 2: N N N N 2022-07-02 13:08:25.106889: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1280] 3: N N N N 2022-07-02 13:08:25.110906: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1406] Created TensorFlow device (/device:GPU:0 with 468 MB memory) -> physical GPU (device: 0, name: NVIDIA GeForce RTX 3090, pci bus id: 0000:18:00.0, compute capability: 8.6) 2022-07-02 13:08:25.114327: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1406] Created TensorFlow device (/device:GPU:1 with 22430 MB memory) -> physical GPU (device: 1, name: NVIDIA GeForce RTX 3090, pci bus id: 0000:3b:00.0, compute capability: 8.6) 2022-07-02 13:08:25.116215: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1406] Created TensorFlow device (/device:GPU:2 with 1250 MB memory) -> physical GPU (device: 2, name: NVIDIA GeForce RTX 3090, pci bus id: 0000:86:00.0, compute capability: 8.6) 2022-07-02 13:08:25.117281: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1406] Created TensorFlow device (/device:GPU:3 with 14009 MB memory) -> physical GPU (device: 3, name: NVIDIA GeForce RTX 3090, pci bus id: 0000:af:00.0, compute capability: 8.6) True >>>
Run these two lines of test code in the python interactive interface. If there is the same output above, congratulations! You are successfully installing
CUDAand its availability. If the Log information stays in a certain line for a long time during the test, and your terminal do not output any information and will not exit the interactive interface, for example, the interactive interface stays atSuccessfully opened dynamic library libcurand.so.10, this is the reason that yourcudatoolkitandcudnnhave an incompatible version,you may need to reinstall this two packages. If your GPU is RTX3090 or below,We recommend that you install according to the recommended version, otherwise, please adapt the corresponding version by yourself.
OSError: Failed to open file b'C:\\Users\\\xe6\x96\x87...\\ AppData\\Local\\Temp\\scipy-xxxxx, The reason for this problem is that the path of the environment variables TEMP and TMP exist in Chinese, so you can change them to pure English path.
If you encounter other package dependency problems, just install them according to the error prompt.
For compatibility, please first install cudatoolkitand cudnn,and then install tensorflow,after this, Install other packages.
Please upload issue if you have any other questions.
Please refer to our usage examples to start using. For more usage, please refer to the API documentation.