title: R Tensorflow - how to upgrade to tf v2
body: <p>I am attempting to use tensorflow to train a GAN in R. I'm getting the following error</p>
  
  <pre><code>AttributeError: module 'tensorflow' has no attribute 'contrib'
  </code></pre>
  
  <p>I've been searching for a solution and found this question
  <a href="https://stackoverflow.com/questions/55870127/module-tensorflow-has-no-attribute-contrib">Module &#39;tensorflow&#39; has no attribute &#39;contrib&#39;</a> which tells me that my code is using TF 1.X syntax.</p>
  
  <p>This directs me to the <code>tf_upgrade_v2</code> script, however it seems to be oriented towards python scripts. Is there a way to upgrade my R script?</p>