Fnet in ZeroCostDL4Mic

I used a few times the Label-free prediction (fnet) on google colab from ZeroCostDL4Mic and it was working great.

But now when I Install Fnet and dependencies I get :

Tensorflow enabled.
Collecting scipy==1.2.0
  Downloading https://files.pythonhosted.org/packages/67/e6/6d4edaceee6a110ecf6f318482f5229792f143e468b34a631f5a0899f56d/scipy-1.2.0-cp36-cp36m-manylinux1_x86_64.whl (26.6MB)
     |████████████████████████████████| 26.6MB 114kB/s 
Requirement already satisfied, skipping upgrade: numpy>=1.8.2 in /usr/local/lib/python3.6/dist-packages (from scipy==1.2.0) (1.18.2)
ERROR: albumentations 0.1.12 has requirement imgaug<0.2.7,>=0.2.5, but you'll have imgaug 0.2.9 which is incompatible.
Installing collected packages: scipy
  Found existing installation: scipy 1.4.1
    Uninstalling scipy-1.4.1:
      Successfully uninstalled scipy-1.4.1
Successfully installed scipy-1.2.0

WARNING: The following packages were previously imported in this runtime:
You must restart the runtime in order to use newly installed versions.

I do as it says and I restart the runtime. But later when I select paths and parameters I get :

FileNotFoundError                         Traceback (most recent call last)

<ipython-input-1-faa72f65f213> in <module>()
     26 #Here we replace values in the old files
     27 #Change maximum pixel number
---> 28 replace("/content/gdrive/My Drive/pytorch_fnet/fnet/transforms.py",'n_max_pixels=9732096','n_max_pixels=20000000')
     29 replace("/content/gdrive/My Drive/pytorch_fnet/predict.py",'6000000','20000000')

<ipython-input-1-faa72f65f213> in replace(file_path, pattern, subst)
     14     fh, abs_path = mkstemp()
     15     with fdopen(fh,'w') as new_file:
---> 16         with open(file_path) as old_file:
     17             for line in old_file:
     18                 new_file.write(line.replace(pattern, subst))

FileNotFoundError: [Errno 2] No such file or directory: '/content/gdrive/My Drive/pytorch_fnet/fnet/transforms.py'

Is there a way of fixing this ?

Thanks a lot for your help

Possibly the runtime needs to be restarted, as suggested by the error message. Could you share a link to the notebook or the code you are running until the error?

Keep in mind you can do bash commands like this:
!pip freeze

Hi @ayakimovich ,

Thanks for your reply, I did restart the runtime as suggested but it still doesn’t work.

The notebook can be found here (you need a google account).
Here you can find the sample data.

In here there are video tutorials and plenty of information about how the whole thing is supposed to work:
github. com/HenriquesLab/ZeroCostDL4Mic/wiki

Thank you for your help

So the entire installation of the notebook relies on you GDrive connected to it as a virtual hard drive. It’s not specific to this notebook from Henriques lab, but rather the way Google Colab people intended for the Colab to be used. In your specific case there is an error with ‘/content/gdrive/My Drive/pytorch_fnet/fnet/transforms.py’. I think this bit is covered in Henriques labs notebook 1.2. Mount your Google Drive. If you have run this part and mounted your drive, you should be able to locate transforms.py file in your GDrive. Was that the case? You might find this intro to colab post useful: How to use free GPU with Google Colab