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

Error:aguments are required: --image during Workflow Parallelization work #1513

Open
LisaLiu11 opened this issue May 2, 2024 · 3 comments
Open
Labels
help wanted Request help

Comments

@LisaLiu11
Copy link

LisaLiu11 commented May 2, 2024

Describe the bug
Hi all,
when I try to use the Parallel workflow for all my pictures running on a terminal, the latest error I got is as follows.
usage: FFinal-plantcv-workflow.py [-h] --image IMAGE --result RESULT --outdir OUTDIR [--writeimg]
[--debug DEBUG]
Final-plantcv-workflow.py: error: the following arguments are required: --image

I get confusion how it works with my script as I'm not a computer expert. As plantcv updates a lot, i havent found any the latest full article or video to learn how Parallel workflow works. I'm using the instructions from plantcv website and also the workshop video (https://www.youtube.com/watch?v=zvn_05cE0L4&t=6225s) and also the latest publication (https://github.com/HausMJ/RootDS_PythonCode/blob/main/Logan_Root_Colorizer_Workflow_v1.2.py) to learn myself how it works. Unfortunately, it is not working for many days.
I'm wondering if there is any clear full instruction released to teach non-expert how this Parallel workflow works? Could anyone please share any suggestions for this issue? I sincerely appreciate your help in advance.

part of my code for input.py based on old instruction is :
def options():
"""Parse command-line options

The options function was converted from the class options in Jupyter.
Rather than hardcoding the inputs, input arguments with the same
variable names are used to retrieve inputs from the commandline.

"""
parser = argparse.ArgumentParser(description="PlantCV plant workflow")
parser.add_argument("--image", help="Input image", required=True)
parser.add_argument("--result", help="Results file", required=True)
parser.add_argument("--outdir", help="Output directory", required=True)
parser.add_argument("--writeimg", help="Save output images", action="store_true")
parser.add_argument("--debug", help="Set debug mode", default=None)
args = parser.parse_args()
return args

Local environment (please complete the following information):

  • OS: [e.g. macOS]
  • Environment [e.g. conda etc.]
  • PlantCV Version [e.g. 4.0]
@LisaLiu11 LisaLiu11 added the help wanted Request help label May 2, 2024
@LisaLiu11 LisaLiu11 changed the title How Workflow Parallelization works Error:aguments are required: --image during Workflow Parallelization work May 2, 2024
@HaleySchuhl
Copy link
Contributor

HaleySchuhl commented May 2, 2024

Hi @LisaLiu11 thanks for opening this issue and providing a good amount of detail, this is very helpful. I noticed that you say you're on v4.0, which means the youtube tutorial is outdated. In version 4 we have transition to a configuration file based parallelization, with aims of being more user friendly and increase reproducibility. We have an example documented here. Hopefully this can resolve your parallelization error, but please do not hesitate to follow up with further questions.

EDIT: It's maybe also worth mentioning there have been a few bug fixes that have merged since our 4.0 release, so I'd recommend updating your plantcv version in your conda environment to 4.2.1 👍

@LisaLiu11
Copy link
Author

Hi Haley,
thank you very much for the guidance. I tried to work again with the latest instruction on the website, I changed my workflow python file into:

Get command-line options

args = workflow_inputs()
pcv.params.debug = args.debug
img, imgpath, imgname = pcv.readimage(filename=args.image)

then run the run plantcv-run-workflow with a config on the terminal, then i got this error:

img, imgpath, imgname = pcv.readimage(filename=args.image)
                                               ^^^^^^^^^^

AttributeError: 'Namespace' object has no attribute 'image'. Did you mean: 'images'?

I tried to change it into (filename=args.images), but it is still not working. Could I ask some suggestion for this situation? sorry for many questions as im really not familar with this part!

@HaleySchuhl
Copy link
Contributor

Admittedly, this is one of the more confusing parts of our current parallelization structure, and we are working to make more complete tutorials hosted with Scribe. This attribute error is one that others have gotten stuck on too, so we talked this morning on ways to improve in v5, but for the time being...

If you change group_name = “auto” in your config file, then it will automatically name your image argument as args.image1. Making these two updates should hopefully resolve that error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Request help
Projects
None yet
Development

No branches or pull requests

2 participants