-
Notifications
You must be signed in to change notification settings - Fork 694
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
[Bug]: error: argument subcommand: invalid choice: 'train' (choose from 'install') #2445
Comments
Hi @xin94wang, thanks for reporting this. Can you also specify your system specs so we could reproduce? Also can you show the output of the following command? anomalib -h |
@samet-akcay I didn't find the file train.py in your library, and I wonder if I don't have the file train.py to cause the error. I have another doubt, if I did not add the file train.py to cause the failure to run, then where is the correct and specific code flow to run, can you provide it? |
Looks like For example this is the output on my env ╭─ Arguments ───────────────────────────────────────────────────────────────────╮
│ Usage: anomalib [-h] [-c CONFIG] [--print_config [=flags]] │
│ {install,fit,validate,test,train,predict,export,benchmark} ...│
│ │
│ │
│ Options: │
│ -h, --help Show this help message and exit. │
│ -c, --config CONFIG Path to a configuration file in json or yaml format. │
│ --print_config [=flags] │
│ Print the configuration after applying all other │
│ arguments and exit. The optional flags customizes the │
│ output and are one or more keywords separated by │
│ comma. The supported flags are: comments, │
│ skip_default, skip_null. │
│ │
│ Subcommands: │
│ For more details of each subcommand, add it as an argument followed by │
│ --help. │
│ │
│ │
│ Available subcommands: │
│ install Install the full-package for anomalib. │
│ fit Runs the full optimization routine. │
│ validate Perform one evaluation epoch over the validation set. │
│ test Perform one evaluation epoch over the test set. It's │
│ separated from fit to make sure you never run on your │
│ train Fit the model and then call test on the trained model.│
│ predict Run inference on a model. │
│ export Export the model to ONNX or OpenVINO format. │
│ benchmark Benchmarking pipeline. │
│ │
╰───────────────────────────────────────────────────────────────────────────────╯
|
I think the problem is most likely that you don't have the proper packages installed. Can you try installing everything via pip? pip install -e ".[full]" |
@ashishbdatta This is where I run pip install -e “. [full]”. (ab_env) C:\Users\50691\anomalib>pip install -e ".[full]" (ab_env) C:\Users\50691\anomalib> |
@samet-akcay When I run pip install -e “. [full]” and then go to execute anomalib train --model Patchcore --data anomalib.data.MVTec, the error is reported as shown here |
hmm, this is peculiar. Can you show the output of |
@samet-akcay |
looks like it is complete. Can you try the API to see if everything else working ok from anomalib.data import MVTec
from anomalib.models import Patchcore
from anomalib.engine import Engine
datamodule = MVTec()
model = Patchcore()
engine = Engine()
engine.train(datamodule=datamodule, model=model) |
Is this running these lines of code directly on the terminal? |
you could create a python file like |
then you should be providing the path to your MVTec dataset when creating the datamodule. for example, ...
datamodule = MVTec(root=</path/to/your/mvtec>)
... |
I would check the dataset. Are you sure that you have the full dataset-category |
I have the same problem and wanted to ask if you solved it? |
no,I have not solved this problem. |
are you on windows as well? Do you use pypi version of anomalib or did you install it from source? |
I'm using a source code installation on Windows. |
If you are using the source code installation then can you try removing the import statements from the try/catch block
It might then print the error |
Describe the bug
Hello, I executed anomalib train --model EfficientAd --data anomalib.data.MVTec --data.train_batch_size 1 after executing anomalib install successfully, and I get this error in the picture.
Dataset
MVTec
Model
N/A
Steps to reproduce the behavior
(ab_env) C:\Users\50691\anomalib>anomalib train --model EfficientAd --data anomalib.data.MVTec --data.train_batch_size 1
To use other subcommand using
anomalib install
Usage: anomalib [-h] [-c CONFIG] [--print_config [=flags]] {install} ...
error: argument subcommand: invalid choice: 'train' (choose from 'install')
OS information
OS information:
Expected behavior
111
Screenshots
No response
Pip/GitHub
pip
What version/branch did you use?
No response
Configuration YAML
111
Logs
Code of Conduct
The text was updated successfully, but these errors were encountered: