Is there anyway to run tensorflow1 and tensorflow2 in one project?
This depends on your ultimate goal. If you want to be able to run the Tensorflow 2 model eagerly in the same python instance or tensorflow instance as a Tensorflow 1 model running in compatibility mode, you will be in a world of trouble. Once you turn on compatibility mode or turn off eager execution, you cannot turn it back on.
I tried to do this for my own project. My quick fix was making a temporary untrainable copy of the model using the weights and biases which have to be extracted and stored in a some format  (I suggest pickle files) that can be opened in the script which makes temporary models without causing an instantiation of tensorflow 1 or tensorflow 2 running in compat mode.
Ultimately, I had to completely rebuild the Tensorflow 1.X model creation and training script in Tensorflow 2.
If you don't need to run them in the same exact script with eager execution for the Tensorflow 2 model then is might... might work to just use compat mode. I know that hearing this sucks, but there really isn't much you can do if the conditions I stated apply to you.
TLDR - It depends on exactly what you want or need, but the foolproof method is just completely rebuilding the model in Tensorflow 2.
I'm in a text2voice(indonesian language) project.I installed g2p-seq2seq for text2phoneme, it contains some codes from tf.contrib so only run with tf1.
Recently I got a new phoneme2voice model which only support tf2. Is there anyway to make them run in one project?