Reputation: 51
This is script which I am using:
import warnings
warnings.filterwarnings('ignore')
import pandas as pd
import sys
import pickle
def azureml_main(dataframe1 = None, dataframe2 = None):
sys.path.append('.\\Script Bundle')
dataframe1 = pickle.load(open(r'/Script Bundle/descript.pkl', 'rb'))
return dataframe1,
but when I execute it , getting below error
FileNotFoundError: [Errno 2] No such file or directory: '/Script
Bundle/descript.pkl'
Process returned with non-zero exit code 1
Upvotes: 1
Views: 1634
Reputation: 8221
The model is available under './Script Bundle'
, you don't need the whole sys.path.append
thing. So you can use something like the code below:
import pandas as pd
import pickle
def azureml_main(dataframe1 = None, dataframe2 = None):
model = pickle.load( open( "./Script Bundle/iris.pkl", "rb" ) )
cleanFrame = dataframe1[['sepal-length','sepal-width','petal-length','petal-width']]
prediction = model.predict(cleanFrame)
dataframe1['Scored Labels'] = prediction
return dataframe1
You can take a look at this ML Studio experiment for an example.
Upvotes: 1