question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Discussion] successfull tf2 automatic upgrade

See original GitHub issue

Hi,

Just wanted to let you know that I upgraded spleeter with tensorflow 2 using tf_upgrade_v2 --intree ./ --outtree ./ --reportfile report.txt from tf2 branch and it is working fine.

Of course the script just replace older function by tf.compat.v1 so it is not the most optimal option…

Here is the report:

TensorFlow 2.0 Upgrade Script
-----------------------------
Converted 31 files
Detected 3 issues that require attention
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
File: ./spleeter/separator.py
--------------------------------------------------------------------------------
./spleeter/separator.py:325:16: WARNING: *.save requires manual check. (This warning is only applicable if the code saves a tf.Keras model) Keras model.save now saves to the Tensorflow SavedModel format by default, instead of HDF5. To continue saving to HDF5, add the argument save_format='h5' to the save() function.
--------------------------------------------------------------------------------
File: ./tests/test_ffmpeg_adapter.py
--------------------------------------------------------------------------------
./tests/test_ffmpeg_adapter.py:79:8: WARNING: *.save requires manual check. (This warning is only applicable if the code saves a tf.Keras model) Keras model.save now saves to the Tensorflow SavedModel format by default, instead of HDF5. To continue saving to HDF5, add the argument save_format='h5' to the save() function.
--------------------------------------------------------------------------------
File: ./tests/test_eval.py
--------------------------------------------------------------------------------
./tests/test_eval.py:68:12: WARNING: *.save requires manual check. (This warning is only applicable if the code saves a tf.Keras model) Keras model.save now saves to the Tensorflow SavedModel format by default, instead of HDF5. To continue saving to HDF5, add the argument save_format='h5' to the save() function.
================================================================================
Detailed log follows:

================================================================================
================================================================================
Input tree: './'
================================================================================
--------------------------------------------------------------------------------
Processing file './setup.py'
 outputting to './setup.py'
--------------------------------------------------------------------------------


--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Processing file './spleeter/dataset.py'
 outputting to './spleeter/dataset.py'
--------------------------------------------------------------------------------

176:20: INFO: Added keywords to args of function 'tf.shape'
241:53: INFO: Renamed 'tf.string_join' to 'tf.strings.join'
256:19: INFO: Added keywords to args of function 'tf.reduce_min'
257:16: INFO: Added keywords to args of function 'tf.shape'
266:15: INFO: Added keywords to args of function 'tf.reduce_any'
267:12: INFO: Added keywords to args of function 'tf.shape'
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Processing file './spleeter/__init__.py'
 outputting to './spleeter/__init__.py'
--------------------------------------------------------------------------------


--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Processing file './spleeter/__main__.py'
 outputting to './spleeter/__main__.py'
--------------------------------------------------------------------------------


--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Processing file './spleeter/separator.py'
 outputting to './spleeter/separator.py'
--------------------------------------------------------------------------------

325:16: WARNING: *.save requires manual check. (This warning is only applicable if the code saves a tf.Keras model) Keras model.save now saves to the Tensorflow SavedModel format by default, instead of HDF5. To continue saving to HDF5, add the argument save_format='h5' to the save() function.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Processing file './spleeter/resources/__init__.py'
 outputting to './spleeter/resources/__init__.py'
--------------------------------------------------------------------------------


--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Processing file './spleeter/utils/configuration.py'
 outputting to './spleeter/utils/configuration.py'
--------------------------------------------------------------------------------


--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Processing file './spleeter/utils/logging.py'
 outputting to './spleeter/utils/logging.py'
--------------------------------------------------------------------------------


--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Processing file './spleeter/utils/__init__.py'
 outputting to './spleeter/utils/__init__.py'
--------------------------------------------------------------------------------


--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Processing file './spleeter/utils/tensor.py'
 outputting to './spleeter/utils/tensor.py'
--------------------------------------------------------------------------------

46:19: INFO: Added keywords to args of function 'tf.shape'
72:17: INFO: Added keywords to args of function 'tf.reduce_min'
73:17: INFO: Added keywords to args of function 'tf.reduce_max'
115:35: INFO: Added keywords to args of function 'tf.shape'
117:13: INFO: Added keywords to args of function 'tf.pad'
120:13: INFO: Added keywords to args of function 'tf.shape'
124:35: INFO: Added keywords to args of function 'tf.shape'
135:17: INFO: Added keywords to args of function 'tf.shape'
140:16: INFO: Added keywords to args of function 'tf.shape'
178:53: INFO: Added keywords to args of function 'tf.shape'
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Processing file './spleeter/utils/estimator.py'
 outputting to './spleeter/utils/estimator.py'
--------------------------------------------------------------------------------


--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Processing file './spleeter/model/__init__.py'
 outputting to './spleeter/model/__init__.py'
--------------------------------------------------------------------------------

221:22: INFO: Added keywords to args of function 'tf.reduce_mean'
226:22: INFO: Added keywords to args of function 'tf.reduce_mean'
227:20: INFO: Added keywords to args of function 'tf.reduce_mean'
227:20: INFO: Renamed keyword argument for tf.reduce_mean from keep_dims to keepdims
236:15: INFO: Added keywords to args of function 'tf.reduce_sum'
278:27: INFO: Added keywords to args of function 'tf.transpose'
280:20: INFO: Added keywords to args of function 'tf.transpose'
335:12: INFO: Added keywords to args of function 'tf.transpose'
341:19: INFO: Added keywords to args of function 'tf.transpose'
343:24: INFO: Added keywords to args of function 'tf.shape'
362:30: INFO: Added keywords to args of function 'tf.shape'
388:28: INFO: Added keywords to args of function 'tf.reduce_mean'
392:25: INFO: Added keywords to args of function 'tf.shape'
412:21: INFO: Added keywords to args of function 'tf.reduce_sum'
425:24: INFO: Added keywords to args of function 'tf.shape'
433:31: INFO: Added keywords to args of function 'tf.shape'
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Processing file './spleeter/model/provider/__init__.py'
 outputting to './spleeter/model/provider/__init__.py'
--------------------------------------------------------------------------------


--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Processing file './spleeter/model/provider/github.py'
 outputting to './spleeter/model/provider/github.py'
--------------------------------------------------------------------------------


--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Processing file './spleeter/model/functions/blstm.py'
 outputting to './spleeter/model/functions/blstm.py'
--------------------------------------------------------------------------------


--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Processing file './spleeter/model/functions/__init__.py'
 outputting to './spleeter/model/functions/__init__.py'
--------------------------------------------------------------------------------


--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Processing file './spleeter/model/functions/unet.py'
 outputting to './spleeter/model/functions/unet.py'
--------------------------------------------------------------------------------


--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Processing file './spleeter/audio/adapter.py'
 outputting to './spleeter/audio/adapter.py'
--------------------------------------------------------------------------------


--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Processing file './spleeter/audio/__init__.py'
 outputting to './spleeter/audio/__init__.py'
--------------------------------------------------------------------------------


--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Processing file './spleeter/audio/ffmpeg.py'
 outputting to './spleeter/audio/ffmpeg.py'
--------------------------------------------------------------------------------


--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Processing file './spleeter/audio/spectrogram.py'
 outputting to './spleeter/audio/spectrogram.py'
--------------------------------------------------------------------------------

37:18: INFO: Added keywords to args of function 'tf.transpose'
39:12: INFO: Added keywords to args of function 'tf.transpose'
62:8: INFO: Added keywords to args of function 'tf.shape'
64:8: INFO: Added keywords to args of function 'tf.shape'
65:14: INFO: Removed argument align_corners for function tf.image.resize_images
65:14: INFO: Renamed 'tf.image.resize_images' to 'tf.image.resize'
70:11: INFO: Renamed 'tf.image.resize_image_with_crop_or_pad' to 'tf.image.resize_with_crop_or_pad'
83:13: INFO: Renamed 'tf.random_uniform' to 'tf.random.uniform'
102:8: INFO: Added keywords to args of function 'tf.shape'
103:8: INFO: Added keywords to args of function 'tf.shape'
105:14: INFO: Removed argument align_corners for function tf.image.resize_images
105:14: INFO: Renamed 'tf.image.resize_images' to 'tf.image.resize'
111:11: INFO: Added keywords to args of function 'tf.pad'
125:21: INFO: Renamed 'tf.random_uniform' to 'tf.random.uniform'
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Processing file './spleeter/audio/convertor.py'
 outputting to './spleeter/audio/convertor.py'
--------------------------------------------------------------------------------

26:11: INFO: Added keywords to args of function 'tf.cond'
27:8: INFO: Added keywords to args of function 'tf.shape'
74:25: INFO: Added keywords to args of function 'tf.reduce_max'
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Processing file './spleeter/commands/evaluate.py'
 outputting to './spleeter/commands/evaluate.py'
--------------------------------------------------------------------------------


--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Processing file './spleeter/commands/__init__.py'
 outputting to './spleeter/commands/__init__.py'
--------------------------------------------------------------------------------


--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Processing file './spleeter/commands/separate.py'
 outputting to './spleeter/commands/separate.py'
--------------------------------------------------------------------------------


--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Processing file './spleeter/commands/train.py'
 outputting to './spleeter/commands/train.py'
--------------------------------------------------------------------------------


--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Processing file './tests/test_github_model_provider.py'
 outputting to './tests/test_github_model_provider.py'
--------------------------------------------------------------------------------


--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Processing file './tests/__init__.py'
 outputting to './tests/__init__.py'
--------------------------------------------------------------------------------


--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Processing file './tests/test_ffmpeg_adapter.py'
 outputting to './tests/test_ffmpeg_adapter.py'
--------------------------------------------------------------------------------

79:8: WARNING: *.save requires manual check. (This warning is only applicable if the code saves a tf.Keras model) Keras model.save now saves to the Tensorflow SavedModel format by default, instead of HDF5. To continue saving to HDF5, add the argument save_format='h5' to the save() function.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Processing file './tests/test_separator.py'
 outputting to './tests/test_separator.py'
--------------------------------------------------------------------------------

45:9: INFO: Renamed 'tf.Session' to 'tf.compat.v1.Session'
66:9: INFO: Renamed 'tf.Session' to 'tf.compat.v1.Session'
83:9: INFO: Renamed 'tf.Session' to 'tf.compat.v1.Session'
101:9: INFO: Renamed 'tf.Session' to 'tf.compat.v1.Session'
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Processing file './tests/test_eval.py'
 outputting to './tests/test_eval.py'
--------------------------------------------------------------------------------

68:12: WARNING: *.save requires manual check. (This warning is only applicable if the code saves a tf.Keras model) Keras model.save now saves to the Tensorflow SavedModel format by default, instead of HDF5. To continue saving to HDF5, add the argument save_format='h5' to the save() function.
--------------------------------------------------------------------------------

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:7

github_iconTop GitHub Comments

1reaction
ltetrelcommented, Dec 10, 2020

@VVasanth Yes I was able to use this code, and I am still using it on my gpu by the way. As I said previously, sadly I did not migrated the spleeter model.

Good luck when porting spleeter into a mobile format, this has a lot of opportunity for the deezer app, allowing any user to listen to a song without the instruments for example!

0reactions
VVasanthcommented, Dec 10, 2020

@ltetrel - If I understand correctly, you have used the above command to migrate the code from TF1 to TF2…and you were able to execute the code without issues…pls confirm on this…

By any chance, did you try to migrate the Spleeter models into TF2 format of ‘savedmodel’? If yes, pls let us know…we are working towards porting spleeter model into edge devices by converting them into TFLite format…Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Upgrade Station - Official TF2 Wiki
An Upgrade Station is a place for players to buy weapon upgrades, ... The UI automatically shades upgrades in a slot if the...
Read more >
Upgrading repo to TF2 #44 - deepmind/dnc
Upgrades repo from TF1 to TF2 while preserving the core design and logic. Quality of life: Formally ... upgrade with auto upgrade script....
Read more >
Effective Tensorflow 2 | TensorFlow Core
This guide provides a list of best practices for writing code using TensorFlow 2 (TF2), it is written for users who have recently...
Read more >
Team Fortress 2 General Discussions
really it's ♥♥♥♥♥♥♥ annoying, Top fragger, most scores, decent amount of healing, good tele use and top of score board and guess what ......
Read more >
State of TF2 (half rant half discussion) : r/tf2
There's like several TF2 projects that have happened solely due to the fact that Valve refuses to fix or update the game. Even...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found