tensorflow / compression

Data compression in TensorFlow
Apache License 2.0
850 stars 248 forks source link

Hific Colab codes are outdated #125

Open yifeipet opened 2 years ago

yifeipet commented 2 years ago

Hello Dr. Balle,

Please check the Colab codes. Can you change the codes and other necessary Tensorflow Compression codes (such as hyperprior models) to fully support Tensorflow 2? New NVIDIA cards do not support old CUDNN libraries that are for Tensorflow 1.15. That can be a big issue if more people buy new NVIDIA cards that cannot support Tensorflow version 1. They might give up Tensorflow Compression or even Tensorflow, and go completely to Pytorch.

Yes, there are Pytorch codes for Hyperprior and Hific. But they might not be official codes so the results by these codes might be not accurate.

Tensorflow version 2 doesn't support LPIPS loss. The pretrained neural network for LPIPS is not in Tensorflow 2. Can you also provide some codes for that?

I understand you are busy. But hope you can solve the most issues. Thank you!

Sincerely, Yifei

fab-jul commented 2 years ago

Hi Yifei, thanks for your interest in HiFiC. I will look into this this week. could you provide some details? It is my understanding that HiFiC does in theory support TF2, but LPIPS does not? Fabian

yifeipet commented 2 years ago

Hi Yifei, thanks for your interest in HiFiC. I will look into this this week. could you provide some details? It is my understanding that HiFiC does in theory support TF2, but LPIPS does not? Fabian

Hi Fabian, I read your HiFic paper, which is outstanding. But I need official codes to replicate the paper results for my PhD student work. Can you check this Tensorflow HiFic link: link? This is only for Tensorflow 1.3.

For LPIPS loss, Tensorflow 2 currently doesn't support it. It's only supported by Tensorflow 1. Please check this link: https://github.com/alexlee-gk/lpips-tensorflow.

Would you mind to update you HiFic codes to Tensorflow 2 codes and provide LPIPS Tensorflow 2 pretrained model?

I trained HiFic model using the Pytorch codes: https://github.com/Justin-Tan/high-fidelity-generative-compression. But I found the big gap between the bpp using entropy loss and the real bpp. I also tested the pretrained model provided by Justin using Kodak dataset on the Colab demo. But I still found a big gap between the theoretical bpp and the real bpp.

Can you please check the issue? You might just use the pretrained model from the Github colab demo to check ithttps://colab.research.google.com/github/Justin-Tan/high-fidelity-generative-compression/blob/master/assets/HiFIC_torch_colab_demo.ipynb If you agree with the HiFic Pytorch codes https://github.com/Justin-Tan/high-fidelity-generative-compression, should I use the theoretical bpp or the real bpp for my comparison experiments?

Yes, I can write the Codes in Tensorflow 2 but I am not sure whether I can replicate close results since my codes are not official codes.

Thank you!

Sincerely, Yifei

yifeipet commented 2 years ago

Hi Yifei, thanks for your interest in HiFiC. I will look into this this week. could you provide some details? It is my understanding that HiFiC does in theory support TF2, but LPIPS does not? Fabian

Hi Fabrian, Any update for HiFic codes? Thank you!

Sincerely, Yifei

hific commented 2 years ago

Hi, there are currently no plans to update the published code. Is it not possible to run it by pinning TF to the version from the requirements?

You should always use real bpp (that's what we use for the paper). I do not know why the code from justin has a big difference there.

MahmoudAshraf97 commented 2 years ago

Hi @yifeipet I successfully ported the LPIPS code from this repo to TF2.x by simply changing the outdated function calls to their respective TF2 counterparts, it works perfectly and I can mail you the new codes to use in your projects

yifeipet commented 2 years ago

Hi @yifeipet I successfully ported the LPIPS code from this repo to TF2.x by simply changing the outdated function calls to their respective TF2 counterparts, it works perfectly and I can mail you the new codes to use in your projects

Great. Thank you! I will try this method to port LPIPS to Tensorflow 2.

apbyju commented 2 years ago

Hi @yifeipet I successfully ported the LPIPS code from this repo to TF2.x by simply changing the outdated function calls to their respective TF2 counterparts, it works perfectly and I can mail you the new codes to use in your projects

Can you please share with me the codes that works with TF2.x

apbyju commented 2 years ago

Hi @MahmoudAshraf97 .. For the compression project I am working on I have a gpu-tf1 compatibility issues. Can you please add the TF2 HiFiC codes to your repo.

MahmoudAshraf97 commented 2 years ago

Hi @apbyju, Unfortunately I'm busy with other work right now so I cant rewrite hific in TF2 but check my repo it has codes to run LPIPS with any TF2 project