The error is due to mismatch in sklearn version in which the OrdinalEncoder has been fitted & where you are trying to inference using it. If you train your model using Azure ML SDK V2 in Azure Cluster with a specific verion of sklearn & register the model & encoder, the sklearn version will mostly be different than your Virtual Machine. If you download the registered encoder to your virtual machine & then try using it, then Python will throw the above error for the OrdinalEncoder due to mismatch of sklearn version. For model training in cluster, use the package version of your Virtual machine. That will resolve the issue.