Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python PytorchJob: no attribute openapi_types for example code #1481

Closed
aikow opened this issue Nov 23, 2021 · 1 comment
Closed

Python PytorchJob: no attribute openapi_types for example code #1481

aikow opened this issue Nov 23, 2021 · 1 comment

Comments

@aikow
Copy link

aikow commented Nov 23, 2021

When trying to start a PytorchJob using the latest example from the PytorchJob documentation, The client fails with:

Traceback (most recent call last):
  File "/Users/aikow/Library/Application Support/JetBrains/PyCharm2021.1/scratches/scratch.py", line 9, in <module>
    with PytorchJob(command=command, args=args, working_dir=working_dir, num_gpus=1, name='aiko-test',
  File "/Users/aikow/Workspace/PycharmProjects/en-nl/langflow/k8s/pytorch_job.py", line 48, in __enter__
    self._start()
  File "/Users/aikow/Workspace/PycharmProjects/en-nl/langflow/k8s/pytorch_job.py", line 57, in _start
    api_response = self.client.create(pytorch_job, namespace=self.namespace)
  File "/Users/aikow/.miniconda3/envs/en-nl/lib/python3.9/site-packages/kubeflow/pytorchjob/api/py_torch_job_client.py", line 65, in create
    outputs = self.custom_api.create_namespaced_custom_object(
  File "/Users/aikow/.miniconda3/envs/en-nl/lib/python3.9/site-packages/kubernetes/client/api/custom_objects_api.py", line 225, in create_namespaced_custom_object
    return self.create_namespaced_custom_object_with_http_info(group, version, namespace, plural, body, **kwargs)  # noqa: E501
  File "/Users/aikow/.miniconda3/envs/en-nl/lib/python3.9/site-packages/kubernetes/client/api/custom_objects_api.py", line 344, in create_namespaced_custom_object_with_http_info
    return self.api_client.call_api(
  File "/Users/aikow/.miniconda3/envs/en-nl/lib/python3.9/site-packages/kubernetes/client/api_client.py", line 348, in call_api
    return self.__call_api(resource_path, method,
  File "/Users/aikow/.miniconda3/envs/en-nl/lib/python3.9/site-packages/kubernetes/client/api_client.py", line 170, in __call_api
    body = self.sanitize_for_serialization(body)
  File "/Users/aikow/.miniconda3/envs/en-nl/lib/python3.9/site-packages/kubernetes/client/api_client.py", line 238, in sanitize_for_serialization
    for attr, _ in six.iteritems(obj.openapi_types)
AttributeError: 'V1PyTorchJob' object has no attribute 'openapi_types'

Process finished with exit code 1

After doing some research, I found numerous threads that suggested rolling back to version 10.0.1, but I also found an issue saying that the issue should be fixed at least for the TFJob.

My current python kubernetes-client version is 18.20.0, since 19.x isn't supported yet by the kubeflow library. My kfp version is version 1.8.9, kfp-pipeline-spec is 0.1.13, and kfp-server-api is 1.7.1.

@stale
Copy link

stale bot commented Mar 2, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the lifecycle/stale label Mar 2, 2022
@stale stale bot closed this as completed Apr 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants