|
17 | 17 |
|
18 | 18 | """A plugin to handle remote tensoflow profiler sessions for Vertex AI."""
|
19 | 19 |
|
20 |
| -from google.cloud.aiplatform.training_utils.cloud_profiler import cloud_profiler_utils |
| 20 | +from google.cloud.aiplatform.training_utils.cloud_profiler import ( |
| 21 | + cloud_profiler_utils, |
| 22 | +) |
21 | 23 |
|
22 | 24 | try:
|
23 | 25 | import tensorflow as tf
|
24 |
| - from tensorboard_plugin_profile.profile_plugin import ProfilePlugin |
| 26 | + from tensorboard_plugin_profile.profile_plugin import ( |
| 27 | + ProfilePlugin, |
| 28 | + ) |
25 | 29 | except ImportError as err:
|
26 | 30 | raise ImportError(cloud_profiler_utils.import_error_msg) from err
|
27 | 31 |
|
|
36 | 40 | import tensorboard.plugins.base_plugin as tensorboard_base_plugin
|
37 | 41 | from werkzeug import Response
|
38 | 42 |
|
39 |
| -from google.cloud.aiplatform.tensorboard.plugins.tf_profiler import profile_uploader |
| 43 | +from google.cloud.aiplatform.tensorboard.plugins.tf_profiler import ( |
| 44 | + profile_uploader, |
| 45 | +) |
40 | 46 | from google.cloud.aiplatform.training_utils import environment_variables
|
41 | 47 | from google.cloud.aiplatform.training_utils.cloud_profiler import wsgi_types
|
42 |
| -from google.cloud.aiplatform.training_utils.cloud_profiler.plugins import base_plugin |
| 48 | +from google.cloud.aiplatform.training_utils.cloud_profiler.plugins import ( |
| 49 | + base_plugin, |
| 50 | +) |
43 | 51 | from google.cloud.aiplatform.training_utils.cloud_profiler.plugins.tensorflow import (
|
44 | 52 | tensorboard_api,
|
45 | 53 | )
|
@@ -68,8 +76,7 @@ def _get_tf_versioning() -> Optional[Version]:
|
68 | 76 | versioning = version.split(".")
|
69 | 77 | if len(versioning) != 3:
|
70 | 78 | return
|
71 |
| - |
72 |
| - return Version(int(versioning[0]), int(versioning[1]), int(versioning[2])) |
| 79 | + return Version(int(versioning[0]), int(versioning[1]), versioning[2]) |
73 | 80 |
|
74 | 81 |
|
75 | 82 | def _is_compatible_version(version: Version) -> bool:
|
@@ -228,7 +235,7 @@ def warn_tensorboard_env_var(var_name: str):
|
228 | 235 | Required. The name of the missing environment variable.
|
229 | 236 | """
|
230 | 237 | logging.warning(
|
231 |
| - f"Environment variable `{var_name}` must be set. " + _BASE_TB_ENV_WARNING |
| 238 | + "Environment variable `%s` must be set. %s", var_name, _BASE_TB_ENV_WARNING |
232 | 239 | )
|
233 | 240 |
|
234 | 241 |
|
|
0 commit comments