A manual for new starters in our group
After learning some thrilling theoretical knowledge about deep learning and medical image analysis, it is time to start a hands-on project! This note will cover all the tips you will need to start a toy project on your own. We will learn to set up a new environment using anaconda, debug python project using Pycharm (it is okay to use other IDLEs), and build a sample segmentation project, segmenting LV from cardiac MR images.
Before we start, it is highly recommended that you use a Linux op system. In our group, we assigned dsi-gpu to undergraduate students. Here are several tips for new linux users:
-
Download MobaXtern (for commanding) and WinSCP (for file transfer).
-
Open MobaXtern
- Click session->ssh; remote host is the ip address, username is your name. Then you shall be connected. See picture below.
!!!!!!ATTENTION: There might be no yourname@ip prefix in your command line, i.e., your command window looks like
This means that you did not enter bash. Type in
/bin/bash
to enter bash. And if you encounter this situation, please DO contact the PhD student who created your account for you to fix this problem.- In the command line, input
ls
and this command will display all the files under your private folder.
-
Open WinSCP
-
Download anaconda 3 from here.
-
Copy the sh file to your private folder '/home/yourname/' and run it with
sh Anaconda3-2021.05-Linux-x86_64.sh
-
After successful installation, input below commands to activate your base environment. At most of the time, it is okay to use base environment directly. If you are still interested in creating independent virtual environment for each of your projects, you can search 'conda virtual env creation' with Google.
conda activate
-
Input below commands to install python for your base environment and check if your python is installed successfully. The output of
which python
should be your anaconda directory.conda install python==3.7 which python which pip
-
We recommend pytorch for starters as the toolkit for deep learning. It is easier to compile and debug (than Tensorflow/Keras/Caffee).
# The cuda version in the default setting is CUDA 11.1 # Pytorch conda install pytorch==1.9.0 torchvision==0.10.0 torchaudio==0.8.0 cudatoolkit=11.1 -c pytorch -c conda-forge # Tensorflow pip install tensorflow==2.4.0
-
We recommend Pycharm as your IDE when you are programming with python. It is okay to choose others. For Pycharm new starters, download Pycharm in your home directory, and unzip the file you downloaded. In your home directory (for me, it is /home/xiaodan/) create a file named "pycharm.sh". Write below content in this file. Remember the directory name should match with your directory.
#!/bin/bash bash /home/xiaodan/pycharm-community-xxxx.xx.xx/bin/pycharm.sh
-
Then, input below commands to start Pycharm.
sh pycharm.sh
-
Try to create a new project in Pycharm. Remember to use
For more instructions on how to build your own dataset, please see in Dataloader.
For more instructions on how to build your own network, please see in Models.
For more instructions on how to start training procedures, please see in training and testing.
For more instructions on how to set up on Google Colab, please see in Set up Google Colab.
If you have questions, please post it on issues, or find answers in FAQ.