Build pipeline failure: Directory error

Copper Contributor



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 "", line 226, in <module>
  File "", 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




0 Replies