quic / aimet-model-zoo

Other
296 stars 53 forks source link

[BUG] aimet_zoo_torch/vit/evaluators/vit_quanteval.py run error!!!! #34

Closed tristanqiu8 closed 1 year ago

tristanqiu8 commented 1 year ago

I followed the installation guideline carefully, However, when I tried to implement on vit got the following error:

2023-05-29 18:33:10,633 - datasets.builder - WARNING - Using custom data configuration default-d5e00ec461c65f0e 2023-05-29 18:33:10,641 - datasets.builder - WARNING - Reusing dataset imagenet (/home/tritan/.cache/huggingface/datasets/imagenet/default-d5e00ec461c65f0e/0.0.0/cd9d2bae638e84705c4c687b1e9c4fb07045e1748a4f78fddbc536f08c0b6572) 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 145.76it/s] Downloading builder script: 4.21kB [00:00, 10.9MB/s]
/home/tritan/anaconda3/envs/aim/lib/python3.8/site-packages/aimet_zoo_torch/vit/model/huggingface/baseline_models/vit/modeling_vit.py:197: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! if height != self.image_size[0] or width != self.image_size[1]: Traceback (most recent call last): File "vit_quanteval.py", line 183, in main() File "vit_quanteval.py", line 138, in main sim_orig = model.get_quantsim(eval_dataloader, eval_function) File "/home/tritan/anaconda3/envs/aim/lib/python3.8/site-packages/aimet_zoo_torch/vit/model/model_definition.py", line 165, in get_quantsim quant_sim = QuantizationSimModel( File "/home/tritan/anaconda3/envs/aim/lib/python3.8/site-packages/aimet_torch/quantsim.py", line 191, in init quantsim_configurator = self.configure_quantization_ops(config_file, default_output_bw, default_param_bw, File "/home/tritan/anaconda3/envs/aim/lib/python3.8/site-packages/aimet_torch/quantsim.py", line 1296, in configure_quantization_ops return QuantSimConfigurator(self.model, self.connected_graph, config_file, default_output_bw, File "/home/tritan/anaconda3/envs/aim/lib/python3.8/site-packages/aimet_torch/quantsim_config/quantsim_config.py", line 112, in init super().init(config_file, quantsim_data_type, quantsim_output_bw, quantsim_param_bw) File "/home/tritan/anaconda3/envs/aim/lib/python3.8/site-packages/aimet_common/quantsim_config/quantsim_config.py", line 145, in init self._quantsim_configs = JsonConfigImporter.import_json_config_file(config_file) File "/home/tritan/anaconda3/envs/aim/lib/python3.8/site-packages/aimet_common/quantsim_config/json_config_importer.py", line 98, in import_json_config_file with open(config_file) as configs: FileNotFoundError: [Errno 2] No such file or directory: '../model/weights/aimet_config'

tristanqiu8 commented 1 year ago

Pip list info: absl-py 1.4.0 accelerate 0.9.0 Aimet torch-gpu-1.24.0 aimet-zoo-torch 1.3.0 AimetCommon torch-gpu-1.24.0 AimetTorch torch-gpu-1.24.0 aiohttp 3.8.4 aiosignal 1.3.1 async-timeout 4.0.2 attrs 23.1.0 beautifulsoup4 4.12.2 bokeh 1.2.0 cachetools 5.3.0 ccimport 0.4.2 certifi 2023.5.7 charset-normalizer 3.1.0 click 8.1.3 coloredlogs 15.0.1 contourpy 1.0.7 cumm-cu111 0.2.8 cycler 0.11.0 dataclasses 0.6 datasets 2.4.0 dill 0.3.5.1 filelock 3.12.0 fire 0.5.0 flatbuffers 23.5.9 fonttools 4.39.4 frozenlist 1.3.3 fsspec 2023.5.0 gdown 4.7.1 google-auth 2.19.0 google-auth-oauthlib 1.0.0 grpcio 1.54.2 h5py 2.10.0 holoviews 1.12.7 huggingface-hub 0.14.1 humanfriendly 10.0 hvplot 0.4.0 idna 3.4 importlib-metadata 6.6.0 importlib-resources 5.12.0 Jinja2 3.0.3 joblib 1.2.0 jsonschema 4.17.3 kiwisolver 1.4.4 lark 1.1.5 Markdown 3.4.3 markdown-it-py 2.2.0 MarkupSafe 2.1.2 matplotlib 3.7.1 mdurl 0.1.2 mpmath 1.3.0 multidict 6.0.4 multiprocess 0.70.13 ninja 1.11.1 numpy 1.23.5 oauthlib 3.2.2 onnx 1.12.0 onnxruntime 1.15.0 onnxruntime-extensions 0.7.0 onnxruntime-gpu 1.15.0 onnxsim 0.4.28 osqp 0.6.3 packaging 23.1 pandas 1.4.3 param 1.13.0 pccm 0.4.7 Pillow-SIMD 7.0.0.post3 pip 23.0.1 pkgutil_resolve_name 1.3.10 portalocker 2.7.0 progressbar2 4.2.0 protobuf 3.20.1 pyarrow 12.0.0 pyasn1 0.5.0 pyasn1-modules 0.3.0 pybind11 2.10.4 Pygments 2.15.1 pyparsing 3.0.9 pyrsistent 0.19.3 PySocks 1.7.1 python-dateutil 2.8.2 python-utils 3.5.2 pytz 2023.3 pyviz-comms 2.3.0 PyYAML 6.0 qdldl 0.1.7 regex 2023.5.5 requests 2.31.0 requests-oauthlib 1.3.1 responses 0.18.0 rich 13.3.5 rsa 4.9 sacremoses 0.0.53 scikit-learn 1.1.3 scipy 1.8.1 setuptools 59.5.0 six 1.16.0 soupsieve 2.4.1 spconv-cu111 2.1.20 sympy 1.12 tensorboard 2.13.0 tensorboard-data-server 0.7.0 tensorboardX 2.4 termcolor 2.3.0 threadpoolctl 3.1.0 tokenizers 0.12.1 torch 1.9.1+cu111 torchvision 0.10.1+cu111 tornado 6.3.2 tqdm 4.65.0 transformers 4.21.0 typing_extensions 4.6.2 urllib3 1.26.16 Werkzeug 2.3.4 wheel 0.38.4 xxhash 3.2.0 yarl 1.9.2 zipp 3.15.0

tristanqiu8 commented 1 year ago

I directly installed aimet_model_zoo by python3 -m pip install ${download_url}/aimetzoo${aimet_zoo_variant}-${release_version}-py3-none-any.whl (rev 1.3)

To use VIT, should I compile the source code and re-install for this package???