Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--compartment argument mismatch #24

Closed
Glassonion opened this issue Sep 20, 2021 · 3 comments · Fixed by #25
Closed

--compartment argument mismatch #24

Glassonion opened this issue Sep 20, 2021 · 3 comments · Fixed by #25
Assignees
Labels
bug Something isn't working

Comments

@Glassonion
Copy link

In setting up a workflow using vanvalenlab/deepcell-applications:0.3.0 I have hit an issue with the --compartment argument.

Everything works as expected for --compartment "nuclear", however trying with --compartment "both" fails with:

/usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/optimizer_v2/optimizer_v2.py:375: UserWarning: The `lr` argument is deprecated, use `learning_rate` instead.
  "The `lr` argument is deprecated, use `learning_rate` instead.")
usage: run_app.py mesmer [-h] [--output-directory OUTPUT_DIRECTORY]
                         [--output-name OUTPUT_NAME]
                         [-L {DEBUG,INFO,WARN,ERROR,CRITICAL}] [--squeeze]
                         --nuclear-image NUCLEAR_PATH
                         [--nuclear-channel NUCLEAR_CHANNEL [NUCLEAR_CHANNEL ...]]
                         [--membrane-image MEMBRANE_PATH]
                         [--membrane-channel MEMBRANE_CHANNEL [MEMBRANE_CHANNEL ...]]
                         [--image-mpp IMAGE_MPP] [--batch-size BATCH_SIZE]
                         [--compartment {nuclear,membrane,whole-cell}]
run_app.py mesmer: error: argument --compartment/-c: invalid choice: 'both' (choose from 'nuclear', 'membrane', 'whole-cell')

While --compartment "membrane" fails with:

Traceback (most recent call last):
  File "/usr/src/app/run_app.py", line 180, in <module>
    output = app.predict(image, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/deepcell/applications/mesmer.py", line 310, in predict
    postprocess_kwargs=postprocess_kwargs)
  File "/usr/local/lib/python3.6/dist-packages/deepcell/applications/application.py", line 448, in _predict_segmentation
    label_image = self._postprocess(output_images, **postprocess_kwargs)
  File "/usr/local/lib/python3.6/dist-packages/deepcell/applications/application.py", line 215, in _postprocess
    image = self.postprocessing_fn(image, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/deepcell/applications/mesmer.py", line 135, in mesmer_postprocess
    'Must be one of {}'.format(compartment, valid_compartments))
ValueError: Invalid compartment supplied: membrane. Must be one of ['whole-cell', 'nuclear', 'both']

Happy to provide more details if helpful.

@ngreenwald ngreenwald self-assigned this Sep 20, 2021
@ngreenwald
Copy link
Contributor

Will, we just need to change the input validation for the kwargs to match what is expected by the model.

@willgraf willgraf added the bug Something isn't working label Sep 20, 2021
@willgraf
Copy link
Contributor

Yes, I think this is just an oversight in our argument parser?

@willgraf
Copy link
Contributor

This issue is resolved in the new release (0.3.1) which should be available in the next 10-20 minutes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants