Valecz
Valecz

Reputation: 83

How to make predictions with Mask R-CNN and python 3.10

My problem:

I have weights for a Mask R-CNN Model, which has been trained using python 3.7 and tensorflow 1.13.1. I can use this environment to make predictions.

I am able to reproduce those predictions using python 3.8 and loading the weights with the Mask R-CNN for tensorflow 2 and tensorflow 2.4.1.

When I use python 3.10 and tensorflow 2.9.1 the prediction process runs without any errors but the results do not make any sense. The class instances are just a view randomly distributed specks. The results look similar for python 3.8 and tensorflow 2.9.1.

Where I'm at

I need to use python 3.10, I don't care about the tensorflow version. I found requirements for an environment that should work for python 3.9 using tensorflow 2.7. But to my understanding for python 3.10 I need tensorflow 2.8 or higher.

What I need

I have no experience with tensorflow or Mask R-CNN so I don't really know where to start. Did someone already encounter this kind of problem, is it something typical and does it point into a certain direction?

Upvotes: 1

Views: 1100

Answers (3)

Kamel
Kamel

Reputation: 41

I also had the problem that my training didn't result in meaningful results. I realized that the problem must have been with the load_weights function. I checked this by using visualize.display_weight_stats(model) before and after the load_weights function. The results were the same. So, in my case, this must mean that the load_weights function doesn't work with this combination of Python version and dependent packages.

Upvotes: 0

Aleena Rayamajhi
Aleena Rayamajhi

Reputation: 31

If you want to use Mask R-CNN without running into problems, create a virtual environment with python 3.7.11 and install the following requirements: tensorflow 2.2.0 keras 2.3.1 protobuf 3.8 numpy 1.20.3 scipy 1.4.1 pillow 8.4.0 cython 0.29.24 scikit-image 0.16.2 matplotlib opencv-python 4.5.4.60 h5py 2.10.0 imgaug 0.4.0 IPython[all] Make sure you have installed Cuda 10.0 and CUDNN 7.4 as well.

Upvotes: 0

Rajat Vardam
Rajat Vardam

Reputation: 1

In my experience as I have been working with Mask RCNN for 9 months now, I humbly request you to give up on trying to run it on python 3.10 as it does not support the older versions of tensorflow. Being stubborn about the python version and not caring about the versions of tensorflow will get you no where. The direction you speak of will only lead you into errors. Unless you would like to try and solve them all.

In my opinion, why should the version matter to you so much? isn't the result what you want? python 3.8 can get you the result so why get so attached to 3.10?

Upvotes: 0

Related Questions