|
1 |
| -// Copyright 2020-2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. |
| 1 | +// Copyright 2020-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. |
2 | 2 | //
|
3 | 3 | // Redistribution and use in source and binary forms, with or without
|
4 | 4 | // modification, are permitted provided that the following conditions
|
@@ -35,25 +35,28 @@ namespace triton { namespace core {
|
35 | 35 | namespace {
|
36 | 36 |
|
37 | 37 | Status
|
38 |
| -GetTFSpecializedBackendName( |
39 |
| - const triton::common::BackendCmdlineConfigMap& config_map, |
40 |
| - std::string* specialized_name) |
| 38 | +CheckTFSpecializedBackendName( |
| 39 | + const triton::common::BackendCmdlineConfigMap& config_map) |
41 | 40 | {
|
42 | 41 | std::string tf_version_str = "2";
|
43 | 42 | const auto& itr = config_map.find("tensorflow");
|
44 | 43 | if (itr != config_map.end()) {
|
45 | 44 | if (BackendConfiguration(itr->second, "version", &tf_version_str).IsOk()) {
|
46 |
| - if ((tf_version_str != "1") && (tf_version_str != "2")) { |
| 45 | + if (tf_version_str == "1") { |
| 46 | + return Status( |
| 47 | + Status::Code::INVALID_ARG, |
| 48 | + "starting from 23.04, Triton no longer supports Tensorflow 1. " |
| 49 | + "Please switch to Tensorflow 2."); |
| 50 | + } |
| 51 | + if (tf_version_str != "2") { |
47 | 52 | return Status(
|
48 | 53 | Status::Code::INVALID_ARG,
|
49 | 54 | "unexpected TensorFlow library version '" + tf_version_str +
|
50 |
| - "', expects 1 or 2."); |
| 55 | + "', expects 2."); |
51 | 56 | }
|
52 | 57 | }
|
53 | 58 | }
|
54 | 59 |
|
55 |
| - *specialized_name += tf_version_str; |
56 |
| - |
57 | 60 | return Status::Success;
|
58 | 61 | }
|
59 | 62 | } // namespace
|
@@ -177,7 +180,7 @@ BackendConfigurationSpecializeBackendName(
|
177 | 180 | {
|
178 | 181 | *specialized_name = backend_name;
|
179 | 182 | if (backend_name == "tensorflow") {
|
180 |
| - RETURN_IF_ERROR(GetTFSpecializedBackendName(config_map, specialized_name)); |
| 183 | + RETURN_IF_ERROR(CheckTFSpecializedBackendName(config_map)); |
181 | 184 | }
|
182 | 185 |
|
183 | 186 | return Status::Success;
|
|
0 commit comments