Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A little trick to use SIUN on Google Colab #12

Open
ghost opened this issue Mar 31, 2021 · 3 comments
Open

A little trick to use SIUN on Google Colab #12

ghost opened this issue Mar 31, 2021 · 3 comments

Comments

@ghost
Copy link

ghost commented Mar 31, 2021

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.

@pranaysingh25
Copy link

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

@IveMalfunctioned
Copy link

Is there a public Colab page for SIUN?

@stefankubal
Copy link

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

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

No branches or pull requests

3 participants