Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upAttributeError: module 'tensorflow._api.v1.compat.v1.compat' has no attribute 'v1 #1802
Comments
EmilsOzolins
added a commit
to LUMII-Syslab/tensor2tensor
that referenced
this issue
Apr 21, 2020
tensorflow._api.v1.compat.v1.compat' has no attribute 'v1. tf already imported as tf.compat.v1 and there is no need to use it explicitly.
afrozenator
pushed a commit
that referenced
this issue
Jun 16, 2020
* Fix issue #1802 tensorflow._api.v1.compat.v1.compat' has no attribute 'v1. tf already imported as tf.compat.v1 and there is no need to use it explicitly. * T2T implementation of Residual Shuffle-Exchange networks. Publication: https://arxiv.org/abs/2004.04662 Original code: https://github.com/LUMII-Syslab/RSE
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
I am using tensot2tensor which is built over Tensorflow and when I reach to the step pf training I got this error AttributeError: module 'tensorflow._api.v1.compat.v1.compat' has no attribute 'v1 and here is my code on google colab
...
!git clone https://github.com/tensorflow/tensor2tensor.git
import os
os.chdir('tensor2tensor')
!ls
!pip install .
import tensorflow as tf
import os
os.mkdir("/content/t2t")
os.mkdir("/content/t2t/data")
os.mkdir("/content/t2t/tmp")
os.mkdir("/content/t2t/train")
os.mkdir("/content/t2t/export")
os.mkdir("/content/t2t/translation")
os.mkdir("/content/t2t/event")
os.mkdir("/content/t2t/user")
DATA_DIR = "/content/t2t/data"
TMP_DIR = "/content/t2t/tmp"
TRAIN_DIR = "/content/t2t/train"
EXPORT_DIR = "/content/t2t/export"
TRANSLATIONS_DIR = "/content/t2t/translation"
EVENT_DIR = "/content/t2t/event"
USR_DIR = "/content/t2t/user"
PROBLEM = "translate_enfr_wmt_small8k" # We chose a problem translation English to French with 32.768 vocabulary
MODEL = "transformer" # Our model
HPARAMS = "transformer_big_single_gpu" # Hyperparameters for the model by default
# If you have a one gpu, use transformer_big_single_gpu
!t2t-datagen
--data_dir=$DATA_DIR
--tmp_dir=$TMP_DIR
--problem=$PROBLEM
--t2t_usr_dir=$USR_DIR
train_steps = 300000 # Total number of train steps for all Epochs
eval_steps = 100 # Number of steps to perform for each evaluation
batch_size = 4096
save_checkpoints_steps = 1000
ALPHA = 0.1
schedule = "continuous_train_and_eval"
!t2t-trainer
--data_dir=$DATA_DIR
--problem=$PROBLEM
--model=$MODEL
--hparams_set=$HPARAMS
--hparams="batch_size=$batch_size"
--schedule=$schedule
--output_dir=$TRAIN_DIR
--train_steps=$train_steps
--worker-gpu=1 \
For bugs: reproduction and error logs