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

Check Type error when loading yolo node. #748

Open
tappyness1 opened this issue Mar 17, 2023 · 2 comments
Open

Check Type error when loading yolo node. #748

tappyness1 opened this issue Mar 17, 2023 · 2 comments

Comments

@tappyness1
Copy link

I have been using Github Actions to run an inference pipeline. One part of it is to load model, which always downloads the weights and proceed to run inference on some images. It was running fine for a few weeks but three days back I encountered the following error.

Run python -m src.main
2023-03-1[7](https://github.com/tappyness1/causion/actions/runs/4448171378/jobs/7810623692#step:7:8) 21:50:47.316131: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /usr/share/miniconda/lib/python3.[8](https://github.com/tappyness1/causion/actions/runs/4448171378/jobs/7810623692#step:7:9)/site-packages/cv2/../../lib64:/opt/hostedtoolcache/Python/3.8.16/x64/lib
2023-03-17 21:50:47.316156: I tensorflow/stream_executor/cuda/cudart_stub.cc:2[9](https://github.com/tappyness1/causion/actions/runs/4448171378/jobs/7810623692#step:7:10)] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
2023-03-17 21:50:48 peekingduck.pipeline.nodes.model.yolo  INFO:  Config for node model.yolo is updated to: 'model_type': v4 
2023-03-17 21:50:48 peekingduck.pipeline.nodes.model.yolo  INFO:  Config for node model.yolo is updated to: 'detect': ['car', 'motorcycle', 'truck', 'bus'] 
2023-03-17 21:50:48 root  ERROR:  Traceback (most recent call last):
   File "/usr/share/miniconda/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
   File "/usr/share/miniconda/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
   File "/home/runner/work/causion/causion/src/main.py", line 67, in <module>
    main()
   File "/home/runner/work/causion/causion/src/main.py", line 17, in main
    inference_obj = inference()
   File "/home/runner/work/causion/causion/src/inference.py", line 63, in __init__
    self.yolo_node = pkd_yolo.Node(model_type = "v4", detect= ["car", "motorcycle", "truck", "bus"])
   File "/usr/share/miniconda/lib/python3.8/site-packages/peekingduck/pipeline/nodes/model/yolo.py", line 80, in __init__
    super().__init__(config, node_path=__name__, **kwargs)
   File "/usr/share/miniconda/lib/python3.8/site-packages/peekingduck/pipeline/nodes/abstract_node.py", line 68, in __init__
    self.load_node_config(config, kwargs)  # type: ignore
   File "/usr/share/miniconda/lib/python3.8/site-packages/peekingduck/pipeline/nodes/abstract_node.py", line [13](https://github.com/tappyness1/causion/actions/runs/4448171378/jobs/7810623692#step:7:14)5, in load_node_config
    self._check_type(self.config, self._get_config_types())
   File "/usr/share/miniconda/lib/python3.8/site-packages/peekingduck/pipeline/nodes/abstract_node.py", line [15](https://github.com/tappyness1/causion/actions/runs/4448171378/jobs/7810623692#step:7:16)1, in _check_type
    check_type(f"{self.node_name}'s `{full_key}`", config[key], config_type)
 
2023-03-[17](https://github.com/tappyness1/causion/actions/runs/4448171378/jobs/7810623692#step:7:18) [21](https://github.com/tappyness1/causion/actions/runs/4448171378/jobs/7810623692#step:7:22):50:48 root  ERROR:  TypeError: check_type() takes 2 positional arguments but 3 were given
 
Error: Process completed with exit code 1.

peekingduck==1.3.0.post1

@tappyness1
Copy link
Author

tappyness1 commented Mar 17, 2023

Issue has to do with typeguard recently updating to 3.0.1, where in 3.0.0, check_type() is no longer backward compatible.

https://typeguard.readthedocs.io/en/latest/versionhistory.html

3.0.0 (2023-03-15)

BACKWARD INCOMPATIBLE Dropped the argname, memo, globals and locals arguments from check_type()

Suggested fix is to edit requirement.txt with:

typeguard==2.13.3 # currently : typeguard >= 2.13.3

@ongtw
Copy link
Contributor

ongtw commented Apr 10, 2023

Thanks for flagging this issue.
This will be updated and fixed in the next PeekingDuck release.
For now, users will have to use the above typeguard fix that you suggested.

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