I'm trying to train Alexnet on a test harness and I am passing the harness the model definition (which is written in TF1.X). All parts of the test harness are functioning properly, but when I pass the model for training I am met with
module 'tensorflow' has no attribute 'contrib'
since my model definition is old and the test harness is running the latest-and-greatest TF2.0 (tensorflow 2.0.0a0).
The posts I've found that address this problem are the following:
Tensorflow 2.0 - AttributeError: module 'tensorflow' has no attribute 'Session'
Module 'tensorflow' has no attribute 'contrib'
but none of them actually solve the issue.
What I've tried:
A recommendation above suggests I upgrade my TF1.X code to TF2.0 by passing files or folders to
tf_upgrade_v2
as described here, but from the release notes (and actually running it) I find that.contrib
is the only library whose conversion isn't supported.The other recommendation (here) was that I could achieve the same results by modifying environmental variables using the
os
module, but the test harness I'm working in doesn't allow me to access environmental variables, so this avenue won't work.- From the TF website I found this which describes a method for converting
tf.contrib.slim
into TF2.0 (seemed promising) but given their proposed solution oftf.contrib.slim
>v1.layers
>keras
this will involve a significant amount of work on my end so I would like to exhaust any other available options before going down this rabbit hole.
What are my options for rewriting Alexnet in TF2.0?