UNetPlusPlus
UNetPlusPlus copied to clipboard
Implementing in colab
I have been trying to implement this code in colab but there is alot of version issue. The requirements file have tensorflow=1.14.1 which is supported by cuda=10.0 My colab have tensorflow=2.2.0 which is supported by 10.1 and i'm getting the following error: AttributeError Traceback (most recent call last)
7 frames
/usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py in placeholder(shape, ndim, dtype, sparse, name) 513 x = tf.sparse_placeholder(dtype, shape=shape, name=name) 514 else: --> 515 x = tf.placeholder(dtype, shape=shape, name=name) 516 x._keras_shape = shape 517 x._uses_learning_phase = False
AttributeError: module 'tensorflow' has no attribute 'placeholder'
Can there be any way in which the above version problem can be rectified?
Maybe try:
%tensorflow_version 1.x
from https://colab.research.google.com/notebooks/tensorflow_version.ipynb ?
1.! python -m pip install Keras==2.3.1 tensorflow==2.1.0 2. import tensorflow.compat.v1 as tf tf.disable_v2_behavior() print(tf.version)
After executing the requirements file we need to run the above two steps to run the code in colab
After following your instructions from the above comment on colab, it gives this error after first epoch:
Epoch 1/70
74/74 [==============================] - 273s 4s/step - loss: 0.4780 - dice_coef: 0.5583 - val_loss: 5.9511 - val_dice_coef: 0.2558
NotImplementedError Traceback (most recent call last)
NotImplementedError: numpy() is only available when eager execution is enabled.
I tried: import tensorflow.compat.v1 as tf tf.enable_eager_execution()
tf.disable_v2_behavior() print(tf.version)
Still same error....@Swathi-Gupta