Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Pruner does not run in Python 3.7.x #5799

Open
adhocmaster opened this issue Jul 4, 2024 · 0 comments
Open

Pruner does not run in Python 3.7.x #5799

adhocmaster opened this issue Jul 4, 2024 · 0 comments

Comments

@adhocmaster
Copy link

adhocmaster commented Jul 4, 2024

Describe the issue:
Literal is not available in the typing package of Python 3.7.x's. It can be fixed by importing from typing_extensions package.

\anaconda3\envs\compression\lib\site-packages\nni\compression\base\config.py in <module>
      7 from copy import deepcopy
      8 import re
----> 9 from typing import Any, Dict, List, Literal, Tuple
     10 
     11 from schema import Schema, Optional, Or

ImportError: cannot import name 'Literal' from 'typing' (...\lib\typing.py)

Environment:

  • NNI version: 3.0
  • Training service (local|remote|pai|aml|etc): local
  • Client OS: windows 10
  • Server OS (for remote mode only):
  • Python version: 3.7.9
  • PyTorch/TensorFlow version: 1.11.0
  • Is conda/virtualenv/venv used?: conda
  • Is running in Docker?: No

Configuration:

  • Experiment config (remember to remove secrets!):
    config_list = [{
    'op_types': ['Linear', 'Conv2d'], # types of layers to prune
    'exclude_op_names': ['fc3'], # exclude specific layers
    'sparse_ratio': 0.3 # mask 30% of the parameters
    }]
  • Search space:

Log message:

  • nnimanager.log:
  • dispatcher.log:
  • nnictl stdout and stderr:

How to reproduce it?:

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant