We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Argument type for InputFile (pathlib.Path) generates issues in some cases.
pathlib.Path
For example, the function tflite.Interpreter from TensorFlow library excepts a string
tflite.Interpreter
'InterpreterWrapper_CreateWrapperCPPFromFile'. Possible C/C++ prototypes are: tflite::interpreter_wrapper::InterpreterWrapper::CreateWrapperCPPFromFile(char const *,std::vector< std::string > const &,std::string *)
However, ipython2cwl adds the parameter as pathlib.Path. Then, the code is not the same and generates the following issue
ipython2cwl
tflite::interpreter_wrapper::InterpreterWrapper::tflite_interpreter_wrapper_InterpreterWrapper_CreateWrapperCPPFromFile__SWIG_1(char const *,PyObject *)
A quick solution can be to change the type of argument but I'm not the effects.
54 parser.add_argument('--modelPath', type=str, required=True)
--------------------------------------------------------------------------- NotImplementedError Traceback (most recent call last) /app/cwl/bin/main in <module> 54 parser.add_argument('--modelPath', type=pathlib.Path, required=True) 55 args = parser.parse_args() ---> 56 main(cameraType=args.cameraType, siteID=args.siteID, modelPath=args. 57 modelPath) /app/cwl/bin/main in main(cameraType, siteID, modelPath) 29 testObj.urlToImage(imageURL) 30 testObj.writeImage(imagePath) ---> 31 interpreter = tflite.Interpreter(model_path=modelPath) 32 interpreter.allocate_tensors() 33 result, percent = testObj.inference(interpreter) /srv/conda/envs/notebook/lib/python3.6/site-packages/tflite_runtime/interpreter.py in __init__(self, model_path, model_content, experimental_delegates) 202 self._interpreter = ( 203 _interpreter_wrapper.InterpreterWrapper_CreateWrapperCPPFromFile( --> 204 model_path, self._custom_op_registerers)) 205 if not self._interpreter: 206 raise ValueError('Failed to open {}'.format(model_path)) NotImplementedError: Wrong number or type of arguments for overloaded function 'InterpreterWrapper_CreateWrapperCPPFromFile'. Possible C/C++ prototypes are: tflite::interpreter_wrapper::InterpreterWrapper::CreateWrapperCPPFromFile(char const *,std::vector< std::string > const &,std::string *) tflite::interpreter_wrapper::InterpreterWrapper::tflite_interpreter_wrapper_InterpreterWrapper_CreateWrapperCPPFromFile__SWIG_1(char const *,PyObject *)
The text was updated successfully, but these errors were encountered:
fix: change type of InputFile arg to string
dcf08eb
fixs: common-workflow-lab#27
No branches or pull requests
Problem
Argument type for InputFile (
pathlib.Path
) generates issues in some cases.For example, the function
tflite.Interpreter
from TensorFlow library excepts a stringHowever,
ipython2cwl
adds the parameter aspathlib.Path
. Then, the code is not the same and generates the following issueSolution
A quick solution can be to change the type of argument but I'm not the effects.
Full error
The text was updated successfully, but these errors were encountered: