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

Resnet example doesn't work #22

Open
itsallmememe opened this issue Nov 30, 2023 · 2 comments
Open

Resnet example doesn't work #22

itsallmememe opened this issue Nov 30, 2023 · 2 comments

Comments

@itsallmememe
Copy link

The dependencies don't seem to be correct. I'm getting this error when I try to build

Starting Docker image cog-resnet-base and running setup()...
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/runpy.py", line 185, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/usr/local/lib/python3.8/runpy.py", line 111, in _get_module_details
    __import__(pkg_name)
  File "/usr/local/lib/python3.8/site-packages/cog/__init__.py", line 1, in <module>
    from pydantic import BaseModel
  File "pydantic/__init__.py", line 2, in init pydantic.__init__
  File "pydantic/dataclasses.py", line 41, in init pydantic.dataclasses
    # +---------+-----------------------------------------+
ImportError: cannot import name dataclass_transform
ⅹ Failed to get container status: exit status 1

If I follow the example on the cog getting started page then it works ok. Their yaml file is as follows

build:
  gpu: true
  python_version: 3.11
  python_packages:
    - pillow==9.5.0
    - tensorflow==2.12.0
predict: "predict.py:Predictor"
@itsallmememe
Copy link
Author

I think I added the gpu line actually, but that's the only change

@robot007
Copy link

@itsallmememe I just fixed this issue on my PC. The problem is due to missing python packages: fastapi, flask, redis, cog.

new cog.yaml

build:
python_version: "3.10.13"
python_packages:
- "pillow>=8.3.1"
- "tensorflow>=2.5.0"
- "flask"
- "redis"
- "cog==0.8.6"
- "fastapi==0.98.0"
predict: "predict.py:Predictor"

robot007 added a commit to robot007/cog-examples-issue22 that referenced this issue Dec 10, 2023
Fix the issue to run the Resnet example
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

2 participants