Closed gullibleretorted closed 3 years ago
Hi @gullibleretorted,
this looks like a version mismatch. For all the pre-trained models, you need to have TensorFlow Compression 2.x installed.
(The training code for HiFiC is the only thing we haven't been able to port to the new version yet, so unfortunately for training this model, you still need TFC 1.3.)
Closing. Please reopen if this doesn't fix it!
That solved it, thank you for this fast response!
Sorry it's me again. But now that I have the compressed .tfci file I now want to decompress it with:
python tfci.py decompress ../../compressed.tfci
but now I get the following error:
Traceback (most recent call last): File "tfci.py", line 339, in <module> app.run(main, flags_parser=parse_args) File "/miniconda2/envs/hific_v1/lib/python3.7/site-packages/absl/app.py", line 303, in run _run_main(main, args) File "/miniconda2/envs/hific_v1/lib/python3.7/site-packages/absl/app.py", line 251, in _run_main sys.exit(main(argv)) File "tfci.py", line 327, in main decompress(args.input_file, args.output_file) File "tfci.py", line 162, in decompress receiver = instantiate_model_signature(packed.model, "receiver") File "/miniconda2/envs/hific_v1/lib/python3.7/site-packages/tensorflow_compression/python/util/packed_tensors.py", line 43, in model buf = self._example.features.feature["MD"].bytes_list.value[0] IndexError: list index (0) out of range
These are packages of my current env: absl-py 0.12.0 astor 0.8.1 astunparse 1.6.3 cached-property 1.5.2 cachetools 4.2.2 certifi 2021.5.30 chardet 4.0.0 cloudpickle 1.6.0 compare-gan 3.0 cycler 0.10.0 decorator 5.0.9 dm-tree 0.1.6 enum34 1.1.10 flatbuffers 1.12 future 0.18.2 gast 0.4.0 gin-config 0.1.4 google-auth 1.30.1 google-auth-oauthlib 0.4.4 google-pasta 0.2.0 googleapis-common-protos 1.53.0 grpcio 1.34.1 h5py 3.1.0 idna 2.10 importlib-metadata 4.4.0 Keras-Applications 1.0.8 keras-nightly 2.5.0.dev2021032900 Keras-Preprocessing 1.1.2 kiwisolver 1.3.1 Markdown 3.3.4 matplotlib 3.4.2 numpy 1.19.5 oauthlib 3.1.1 opt-einsum 3.3.0 pandas 1.2.4 Pillow 8.1.2 pip 21.1.1 promise 2.3 protobuf 3.17.1 pstar 0.1.9 pyasn1 0.4.8 pyasn1-modules 0.2.8 pyparsing 2.4.7 python-dateutil 2.8.1 pytz 2021.1 qj 0.1.7 requests 2.25.1 requests-oauthlib 1.3.0 rsa 4.7.2 scipy 1.6.3 setuptools 52.0.0.post20210125 six 1.15.0 tensorboard 2.5.0 tensorboard-data-server 0.6.1 tensorboard-plugin-wit 1.8.0 tensorflow 2.5.0 tensorflow-compression 2.2 tensorflow-datasets 1.0.1 tensorflow-estimator 2.5.0 tensorflow-gan 0.0.0.dev0 tensorflow-gpu 1.15.5 tensorflow-hub 0.12.0 tensorflow-metadata 1.0.0 tensorflow-probability 0.12.2 termcolor 1.1.0 tqdm 4.61.0 typing-extensions 3.7.4.3 urllib3 1.26.5 Werkzeug 2.0.1 wheel 0.36.2 wrapt 1.12.1 zipp 3.4.1
Thanks a ton in advance!
I am not quite sure, what the mistake was on my side, but I tried it now with the linked colab code and took the compressed .tfci file and tried the decompress method locally and it worked. After that I again tried the whole process (compress and decompress) with the following steps and it worked:
python tfci.py compress hific-lo ../../007480.png
python tfci.py decompress ../../007480.png.tfci
Sorry for any inconvenience!
No problem, glad you fixed it.
Describe the bug When I want to test the compress function with a pretrained model with:
python tfci.py compress hific-hi ../../007480.png
I get the following error message:
INFO:tensorflow:Saver not created because there are no variables in the graph to restore I0603 22:12:08.017330 140314375669568 saver.py:1503] Saver not created because there are no variables in the graph to restore 2021-06-03 22:12:10.414583: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcuda.so.1 2021-06-03 22:12:10.475969: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1639] Found device 0 with properties: name: GeForce GTX 1080 Ti major: 6 minor: 1 memoryClockRate(GHz): 1.6325 pciBusID: 0000:01:00.0 2021-06-03 22:12:10.476694: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudart.so.10.0 2021-06-03 22:12:10.477960: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcublas.so.10.0 2021-06-03 22:12:10.479149: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcufft.so.10.0 2021-06-03 22:12:10.479723: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcurand.so.10.0 2021-06-03 22:12:10.481156: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcusolver.so.10.0 2021-06-03 22:12:10.482433: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcusparse.so.10.0 2021-06-03 22:12:10.485634: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudnn.so.7 2021-06-03 22:12:10.487087: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1767] Adding visible gpu devices: 0 Traceback (most recent call last): File "tfci.py", line 339, in <module> app.run(main, flags_parser=parse_args) File "/miniconda2/envs/hific_v1/lib/python3.7/site-packages/absl/app.py", line 303, in run _run_main(main, args) File "/miniconda2/envs/hific_v1/lib/python3.7/site-packages/absl/app.py", line 251, in _run_main sys.exit(main(argv)) File "tfci.py", line 325, in main args.target_bpp, args.bpp_strict) File "tfci.py", line 119, in compress bitstring = compress_image(model, input_image) File "tfci.py", line 104, in compress_image packed.pack(tensors) TypeError: pack() missing 1 required positional argument: 'arrays'
I did some research online, but didnt find any help to solve this issue. Can you help me out here? I guess its a pretty straight forward mistake on my side. Thanks a lot in advance!
To Reproduce Steps to reproduce the behavior:
Expected behavior A clear and concise description of what you expected to happen.
System (please complete the following information):
absl-py 0.12.0 astor 0.8.1 certifi 2021.5.30 chardet 4.0.0 compare-gan 3.0 cycler 0.10.0 enum34 1.1.10 future 0.18.2 gast 0.2.2 gin-config 0.1.4 google-pasta 0.2.0 googleapis-common-protos 1.53.0 grpcio 1.38.0 h5py 2.10.0 idna 2.10 importlib-metadata 4.4.0 Keras-Applications 1.0.8 Keras-Preprocessing 1.1.2 kiwisolver 1.3.1 Markdown 3.3.4 matplotlib 3.4.2 numpy 1.18.5 opt-einsum 3.3.0 pandas 1.2.4 Pillow 8.1.2 pip 21.1.1 promise 2.3 protobuf 3.17.1 pstar 0.1.9 pyasn1 0.4.8 pyparsing 2.4.7 python-dateutil 2.8.1 pytz 2021.1 qj 0.1.7 requests 2.25.1 scipy 1.6.3 setuptools 52.0.0.post20210125 six 1.16.0 tensorboard 1.15.0 tensorflow-compression 1.3 tensorflow-datasets 1.0.1 tensorflow-estimator 1.15.1 tensorflow-gan 0.0.0.dev0 tensorflow-gpu 1.15.5 tensorflow-hub 0.12.0 tensorflow-metadata 1.0.0 termcolor 1.1.0 tqdm 4.61.0 typing-extensions 3.10.0.0 urllib3 1.26.5 Werkzeug 2.0.1 wheel 0.36.2 wrapt 1.12.1 zipp 3.4.1