Documentation seems to be inaccurate (at least for azureml.core.__version__ in {'1.19.0', '1.20.0'}
)
The /source/[model/]
directory in the deployed container is not in the working directory where the script is executed.
I fixed this by adding a search for my files in the init(
method:
# The top argument for walk
topdir = '..'
# The extension to search for
_pkl = '.pkl'
_csv = '.csv'
csv_name = 'exceptions'
model_name = 'model1'
imputer_name = 'model2'
paths = {}
for dirpath, dirnames, files in os.walk(topdir):
for name in files:
if name.lower().endswith(_pkl) and model_name in name:
paths[model_name] = os.path.join(dirpath, name)
elif name.lower().endswith(_csv) and csv_name in name:
paths[csv_name] = os.path.join(dirpath, name)
elif name.lower().endswith(_pkl) and imputer_name in name:
paths[imputer_name] = os.path.join(dirpath, name)
Then using the respective values in paths
to joblib.load(
models and pd.read_csv(
extra data.