shiveshc / NIDDL

Deep denoising pushes the limit of functional data acquisition by recovering high SNR calcium traces from low SNR videos acquired using low laser power or smaller exposure time. Thus deep denoising enables faster and longer volumetric recordings.
GNU General Public License v2.0
9 stars 3 forks source link

Positional argument max_proj error while training #6

Open RuthKassahun opened 3 months ago

RuthKassahun commented 3 months ago

Hello,

Thank you for sharing your great work. I want to test the denoising with your network. I've installed everything as mention, however I have some issues while running specifically with the positional argument max_projection

(niddl) D:\Code\NIDDL-main>python train.py D:/Code/training_for_niddl/data 1 0 -out D:/Code/training_for_niddl/output -arch unet_fixed -mode 2D -loss l1 -epoch 1 -bs 10

usage: train.py [-h] [-out OUT]

                [-arch {unet,unet_fixed,hourglass_wres,hourglass_wores}]
                [-mode {2D,2.5D,3D}] [-depth DEPTH] [-loss {l2,l1}]
                [-epochs EPOCHS] [-lr LR] [-bs BS] [-tsize TSIZE]
                data run {1,0}
train.py: error: argument max_proj: invalid choice: '0' (choose from 1, 0)

I get an argument error train.py: error: argument max_proj: invalid choice: '0' (choose from 1, 0) eventhough I choose 0 for the network not to apply on max_projection of the stack. Can you please let me know what goes wrong here.

shiveshc commented 3 months ago

Hi

Thanks a lot for trying out NIDDL.

This was due to a bug in the code (hopefully fixed now). Choices for max_proj are integers 0 or 1. However the way max_proj was being parsed in parse_argument function was reading a string '0' from the input. This has been fixed now by specifying type int of the input as - parser.add_argument('max_proj', type=int, choices= [1, 0], help= '1 if train network on max projection of 3D stacks else 0', default= 0)

Also I would highly recommend you to try the new pytorch version of the code. You can see that by selecting the pytorch branch on the repo page. To clone pytorch branch, do - git clone -b pytorch https://github.com/shiveshc/NIDDL.git

Some advantages of using the pytorch version are -

  1. Much easier installation and setup
  2. Run through example.ipynb to try training and inference quickly in notebook
  3. Napari plugin for denoising in Napari using your trained model. Simply run napari_niddl.py and follow instructions in Napari.

Hope this helps.