Hi All,
I am new to DataRobot and I try to use API to train the model.
I am using this document. I was able to upload the dataset but it gives me error when I want to train the model. In the UI I see that the project is already successfully created and the dataset is uploaded. Any help would be appreciated.
# Use training data to build models
from datarobot import AUTOPILOT_MODE
# Set the project's target and initiate Autopilot (runs in Quick mode unless a different mode is specified)
project.analyze_and_model(target='mpg', worker_count=-1, mode=AUTOPILOT_MODE.QUICK)
# Open the project's Leaderboard to monitor the progress in UI.
project.open_in_browser()
# Wait for the model creation to finish
project.wait_for_autopilot()
model = project.get_top_model()
ClientError Traceback (most recent call last) File ~\.conda\envs\VZPredFin2\lib\site-packages\datarobot\models\project_options.py:1029, in ProjectOptions.get(cls, project_id) 1028 path = f"projects/{project_id}/options/" -> 1029 new_project_options = cls.from_location(path) 1030 if new_project_options.project_id is None: 1031 # Newly created projects return an empty json object, so we need to seed this 1032 # new project options instance with the correct project_id File ~\.conda\envs\VZPredFin2\lib\site-packages\datarobot\models\api_object.py:49, in APIObject.from_location(cls, path, keep_attrs) 47 @classmethod 48 def from_location(cls: Type[T], path: str, keep_attrs: Optional[List[str]] = None) -> T: ---> 49 server_data = cls._server_data(path) 50 return cls.from_server_data(server_data, keep_attrs=keep_attrs) File ~\.conda\envs\VZPredFin2\lib\site-packages\datarobot\models\api_object.py:85, in APIObject._server_data(cls, path) 83 @classmethod 84 def _server_data(cls, path: str) -> ServerDataType: ---> 85 return cls._client.get(path).json() File ~\.conda\envs\VZPredFin2\lib\site-packages\datarobot\rest.py:191, in RESTClientObject.get(self, url, params, **kwargs) 190 def get(self, url: str, params: Optional[Any] = None, **kwargs: Any) -> Response: # type: ignore[override] --> 191 return self.request("get", url, params=to_api(params), **kwargs) File ~\.conda\envs\VZPredFin2\lib\site-packages\datarobot\rest.py:187, in RESTClientObject.request(self, method, url, join_endpoint, **kwargs) 186 if not response: --> 187 handle_http_error(response, **kwargs) 188 return response File ~\.conda\envs\VZPredFin2\lib\site-packages\datarobot\rest.py:365, in handle_http_error(response, **kwargs) 364 exc_message = template.format(response.status_code, message) --> 365 raise exception_type(exc_message, response.status_code, json=parsed_json) 366 else: ClientError: 404 client error: {'message': 'Not Found'} During handling of the above exception, another exception occurred: ClientError Traceback (most recent call last) Cell In[22], line 5 2 from datarobot import AUTOPILOT_MODE 4 # Set the project's target and initiate Autopilot (runs in Quick mode unless a different mode is specified) ----> 5 project.analyze_and_model(target='mpg', worker_count=-1, mode=AUTOPILOT_MODE.QUICK) 7 # Open the project's Leaderboard to monitor the progress in UI. 8 project.open_in_browser() File ~\.conda\envs\VZPredFin2\lib\site-packages\datarobot\models\project.py:1515, in Project.analyze_and_model(self, target, mode, metric, worker_count, positive_class, partitioning_method, featurelist_id, advanced_options, max_wait, target_type, credentials, feature_engineering_prediction_point, unsupervised_mode, relationships_configuration_id, class_mapping_aggregation_settings, segmentation_task_id, unsupervised_type, autopilot_cluster_list) 1510 self.set_worker_count(worker_count) 1512 aim_payload = self._construct_aim_payload(target, mode, metric) 1514 self._load_autopilot_options( -> 1515 opts=advanced_options if advanced_options else self._options, payload=aim_payload 1516 ) 1517 if positive_class is not None: 1518 aim_payload["positive_class"] = positive_class File ~\.conda\envs\VZPredFin2\lib\site-packages\datarobot\models\project.py:390, in Project._options(self) 387 @property 388 def _options(self) -> ProjectOptions: 389 if self.__options is None: --> 390 self.__options = ProjectOptions.get(self.id) 391 return self.__options File ~\.conda\envs\VZPredFin2\lib\site-packages\datarobot\models\project_options.py:1038, in ProjectOptions.get(cls, project_id) 1035 except ClientError as ex: 1036 # If we receive a 404, it's because this project doesn't exist in DataRobot yet. 1037 if ex.status_code == 404: -> 1038 raise ClientError( 1039 "Project options for this project do not exist. " 1040 "Please create a project in DataRobot first in order to retrieve the project's options.", 1041 status_code=ex.status_code, 1042 ) 1043 # If it's something other than a 404, the error needs to be raised to the 1044 # user. 1045 else: 1046 raise ex ClientError: Project options for this project do not exist. Please create a project in DataRobot first in order to retrieve the project's options.
DataRobot version: 3.1.0
Thanks for the answer. I got this output:
{'major': 2, 'minor': 28, 'versionString': '2.28'}
'https://(_masked_).vpc.(_masked_).com//api/v2'
It's possible that the version you are using is incompatible your SDK version. Here are a few steps you can take to help us narrow down the issue:
After the client has been initialized, check the API version of your install
dr.client.get_client().get('version/').json()
We can also learn more about the instance you are using by reading the output of
dr.client.get_client().endpoint
Let us know what these come back with!
Hi, Thanks for the answer. I tried again and got the same error. Maybe you are using a different code.I am not sure which one aplies to me but I got access throught the company. Thanks.
Hi @KnowledgeExplorer , thanks for reaching out to the community and for your patience as we looked into this. I circulated your issue internally to see if we could provide some assistance - the team went through example steps and everything worked as expected in DR Notebooks.
Can you let us know if you are a Self-Managed AI Platform customer or if you use cloud so we can help you find the best solution?