Skip to content

How to fix "ImportError: cannot import name 'dataclass'"? #1

@htliu6

Description

@htliu6

Excuse me, I encountered following issues when setting up edge node. Have you ever notice this problem? Thanks!

$ python3 edge_main.py -f ~/cutout1.mp4 -i 50
Traceback (most recent call last):
  File "edge_main.py", line 14, in <module>
    from local.decision_engine import DecisionEngine
  File "/home/htliu/SmartEye/local/decision_engine.py", line 4, in <module>
    from model_manager.model_cache import get_fastest_model, get_most_precise_model
  File "/home/htliu/SmartEye/model_manager/model_cache.py", line 3, in <module>
    import torch
  File "/home/htliu/.local/lib/python3.6/site-packages/torch/__init__.py", line 627, in <module>
    import torch.utils.data
  File "/home/htliu/.local/lib/python3.6/site-packages/torch/utils/data/__init__.py", line 6, in <module>
    from .dataloader import DataLoader, _DatasetKind, get_worker_info
  File "/home/htliu/.local/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 21, in <module>
    from . import _utils
  File "/home/htliu/.local/lib/python3.6/site-packages/torch/utils/data/_utils/__init__.py", line 45, in <module>
    from . import worker, signal_handling, pin_memory, collate, fetch
  File "/home/htliu/.local/lib/python3.6/site-packages/torch/utils/data/_utils/worker.py", line 10, in <module>
    from dataclasses import dataclass
ImportError: cannot import name 'dataclass'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions