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

Cant get project using the python api #6

Open
Geekgineer opened this issue Jun 24, 2023 · 0 comments
Open

Cant get project using the python api #6

Geekgineer opened this issue Jun 24, 2023 · 0 comments

Comments

@Geekgineer
Copy link

Thanks for the amazing tool 💯

Issue Description

I encountered an error while running the import_coco_datagym.py script from the datagym-core package using Version: 0.7.2, Python 3.8.10. The error is related to JSON decoding and occurs during the execution of the script.

Steps to Reproduce

  1. Run the import_coco_datagym.py script with the following command:
from datagym import Client

client = Client(api_key="d676b704-079f-4384-ae3f-XXXXX")

# projects = client.get_projects()
dummy_project = client.get_project_by_name(project_name="Dummy_Project")

Error Message

After running the localhost and obtaining the user token.

Traceback (most recent call last):
  File "datagym-core/import_coco_datagym.py", line 10, in <module>
    dummy_project = client.get_project_by_name(project_name="Dummy_Project")
  File "/home/pc-ws/.local/lib/python3.8/site-packages/datagym/client.py", line 192, in get_project_by_name
    projects = self.get_projects()
  File "/home/pc-ws/.local/lib/python3.8/site-packages/datagym/client.py", line 176, in get_projects
    projects = self._get_projects_without_images()
  File "/home/pc-ws/.local/lib/python3.8/site-packages/datagym/client.py", line 165, in _get_projects_without_images
    if self._response_valid(response):
  File "/home/pc-ws/.local/lib/python3.8/site-packages/datagym/client.py", line 129, in _response_valid
    elif json.loads(response.content)["key"] in WARNING_KEYS:
  File "/usr/lib/python3.8/json/__init__.py", line 357, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.8/json/decoder.py", line 340, in decode
    raise JSONDecodeError("Extra data", s, end)
json.decoder.JSONDecodeError: Extra data: line 1 column 5 (char 4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant