minyuanye/SIUN

A little trick to use SIUN on Google Colab

Opened this issue · 3 comments

This is not really a issue, but a little help for those who want to use this project directly on Google Colab without any installation requirement (the default preinstalled setting of Google Colab)

Code Trick

You just need to replace :

import tensorflow.as tf

by

import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()

in the head on the following two files :

  • /SIUN/code/src/lib/tf_util.py
  • /SIUN/code/src/model/model.py

allowing to the code working with tensorflow 2>

Notebook

Now create a simple notebook with a cell for the project cloning

!git clone https://github.com/minyuanye/SIUN.git

Another to set the working directory

%cd '/content/SIUN/code/'

For my own case, I mount Google Drive with this cell

from google.colab import drive
drive.mount('/content/gdrive', force_remount=True)

Now, just call the process

!python deblur.py --apply --dir-path='/content/gdrive/My Drive/myimagedir/'

An option is to build a zip of the result directory

!zip -r /content/output.zip /content/SIUN/code/output

That's all. Hope that helps.

Hi, Thanks for taking the effort to write up this guide. This helps alot.

I did what you told, I still gets this error

image

I am confused what to do ? which version of tensorflow has this method "depth_to_space" v1 or v2. Is there a way around to this as well ?? If you can help that would be lot helpful for me.

Thanks,
Pranay

Is there a public Colab page for SIUN?

Hey, I am struggling to get anywhere running this? Has anyone been able to recently?