Commit a9e29eb
authored
Fix bug in converter to load saved model (#1981)
BUG
Fix a bug that prohibits the conversion of a Saved Model produced by AutoML object detection.
The error was produced by an internal `convert_variables_to_constants() method`:
`ValueError: Cannot find the variable that is an input to the ReadVariableOp.`
Comparing our code to the `freeze_graph` util showed that we were not loading the graph properly into a Session object, before calling `convert_variables_to_constants()`.
The unit test emulates the Saved Model by adding a hash table op that is not used by the inference signature. Verified that this test fails at master.
Cloud will make an integration test internally that asserts that this conversion continuous to work.1 parent 61b355e commit a9e29eb
File tree
3 files changed
+93
-18
lines changed- tfjs-converter/python
- tensorflowjs/converters
3 files changed
+93
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
Lines changed: 16 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
32 | 34 | | |
33 | 35 | | |
34 | 36 | | |
| |||
272 | 274 | | |
273 | 275 | | |
274 | 276 | | |
275 | | - | |
276 | | - | |
277 | | - | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
278 | 285 | | |
279 | | - | |
280 | | - | |
281 | | - | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
282 | 289 | | |
283 | | - | |
| 290 | + | |
284 | 291 | | |
285 | 292 | | |
286 | 293 | | |
| |||
336 | 343 | | |
337 | 344 | | |
338 | 345 | | |
339 | | - | |
340 | | - | |
| 346 | + | |
| 347 | + | |
341 | 348 | | |
342 | 349 | | |
343 | 350 | | |
| |||
Lines changed: 76 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
83 | 121 | | |
84 | 122 | | |
85 | 123 | | |
| |||
192 | 230 | | |
193 | 231 | | |
194 | 232 | | |
| 233 | + | |
| 234 | + | |
195 | 235 | | |
196 | | - | |
197 | | - | |
| 236 | + | |
| 237 | + | |
198 | 238 | | |
199 | 239 | | |
200 | | - | |
| 240 | + | |
201 | 241 | | |
202 | 242 | | |
203 | 243 | | |
204 | | - | |
| 244 | + | |
205 | 245 | | |
206 | 246 | | |
207 | 247 | | |
208 | 248 | | |
209 | 249 | | |
210 | | - | |
| 250 | + | |
211 | 251 | | |
212 | 252 | | |
213 | 253 | | |
214 | 254 | | |
215 | 255 | | |
216 | 256 | | |
217 | 257 | | |
218 | | - | |
219 | | - | |
220 | | - | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
221 | 289 | | |
222 | 290 | | |
223 | 291 | | |
| |||
0 commit comments