Forum Discussion
mohitfoundazure
Aug 10, 2023Copper Contributor
Build pipeline failure: Directory error
Hi
I am facing an error while saving a trained model in the build pipeline. Here is my model training script (azure ml v1) to train the model
Here is the error from the
The path as shown below is not a directory but it triggers a IsADirectoryError and is quite confusing to understand the actual issue.
Model Score : 0.9333333333333333
Saving file: /mnt/azureml/cr/j/36bcb34581c24a669f6c9ca86580cd76/exe/wd/iris_model.pkl
Cleaning up all outstanding Run operations, waiting 300.0 seconds
1 items cleaning up...
Cleanup took 0.12509465217590332 seconds
Traceback (most recent call last):
File "training.py", line 226, in <module>
iris_classifier.create_pipeline()
File "training.py", line 115, in create_pipeline
with open(filePath, 'wb') as file:
IsADirectoryError: [Errno 21] Is a directory: '/mnt/azureml/cr/j/36bcb34581c24a669f6c9ca86580cd76/exe/wd/iris_model.pkl'
Python (3.9) Code to save the trained model
Thanks
No RepliesBe the first to reply