I'm trying to run Mask-RCNN on a jupyter notebook (on colab).
Im using the following repository: !git clone https://github.com/matterport/Mask_RCNN.git
there are a few changes that need to be done to make it run properly, for example changing the KE.Layer cases to KE.base_layer.Layer in the model.py file.
but still, at the end the following error is shown:
TypeError: Could not build a TypeSpec for KerasTensor(type_spec=TensorSpec(shape=(None, None, 4), dtype=tf.float32, name=None), name='tf.math.truediv/truediv:0', description="created by layer 'tf.math.truediv'") of unsupported type <class 'keras.engine.keras_tensor.KerasTensor'>.
I found this thread, which claims that this is a compatibility issue.
That pulled me into a vicious-cycle of compatibility issues, and still no working solution:
first, I then figured out that the requirements.text
file is not being used at all, because of other compatibility issues with the parse_requirements
method in the pip package, and the solution for this is here (answer by @sinoroc).
Second, when I'm trying to use an older version of tensorflow, it does not find any:
ERROR: Could not find a version that satisfies the requirement tensorflow==1.3.0 (from versions: 2.2.0, 2.2.1, 2.2.2, 2.2.3, 2.3.0, 2.3.1, 2.3.2, 2.3.3, 2.3.4, 2.4.0, 2.4.1, 2.4.2, 2.4.3, 2.4.4, 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.6.0rc0, 2.6.0rc1, 2.6.0rc2, 2.6.0, 2.6.1, 2.6.2, 2.6.3, 2.6.4, 2.6.5, 2.7.0rc0, 2.7.0rc1, 2.7.0, 2.7.1, 2.7.2, 2.7.3, 2.7.4, 2.8.0rc0, 2.8.0rc1, 2.8.0, 2.8.1, 2.8.2, 2.8.3, 2.8.4, 2.9.0rc0, 2.9.0rc1, 2.9.0rc2, 2.9.0, 2.9.1, 2.9.2, 2.9.3, 2.10.0rc0, 2.10.0rc1, 2.10.0rc2, 2.10.0rc3, 2.10.0, 2.10.1, 2.11.0rc0, 2.11.0rc1, 2.11.0rc2, 2.11.0)
(only v2+).
This -can- be circumvented by !pip3 install https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.14.0-py3-none-any.whl
BUT there are two following issues:
1 - I need it as part of the requirements.txt
file in the maskrcnn folder, and I am not able to make it run from there.
2 - this also creates compatibility issues:
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. kapre 0.3.7 requires tensorflow>=2.0.0, but you have tensorflow 1.14.0 which is incompatible.
Question: is there a way to resolve these issues? maybe there is an updated Mask-RCNN version that resolves these compatibilities?
It is crucial for me that the solution will be able to accept custom classes (my data is coco style, but with custom classes) and be able to run on a colab notebook.