FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
TensorFlow.NET/src/TensorflowNET.Hub/module_v2.cs at master · murmansoft/TensorFlow.NET · GitHub
murmansoft
/
TensorFlow.NET
Public
forked from
SciSharp/TensorFlow.NET
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
TensorFlow.NET
/
src
/
TensorflowNET.Hub
/
module_v2.cs
Copy path
More file actions
More file actions
Latest commit
History
History
History
33 lines (28 loc) · 1.21 KB
Breadcrumbs
TensorFlow.NET
/
src
/
TensorflowNET.Hub
/
module_v2.cs
Copy path
File metadata and controls
33 lines (28 loc) · 1.21 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
using
System
.
IO
;
using
Tensorflow
.
Train
;
namespace
Tensorflow
.
Hub
{
internal
static
class
module_v2
{
public
static
Trackable
load
(
string
handle
,
LoadOptions
?
options
)
{
var
module_path
=
resolve
(
handle
)
;
// TODO(Rinne): deal with is_hub_module_v1
var
saved_model_path
=
Path
.
Combine
(
module_path
,
Constants
.
SAVED_MODEL_FILENAME_PB
)
;
var
saved_model_pb_txt_path
=
Path
.
Combine
(
module_path
,
Constants
.
SAVED_MODEL_FILENAME_PBTXT
)
;
if
(
!
File
.
Exists
(
saved_model_path
)
&&
!
Directory
.
Exists
(
saved_model_path
)
&&
!
File
.
Exists
(
saved_model_pb_txt_path
)
&&
!
Directory
.
Exists
(
saved_model_pb_txt_path
)
)
{
throw
new
ValueError
(
$
"Trying to load a model of incompatible/unknown type. "
+
$
"'
{
module_path
}
' contains neither '
{
Constants
.
SAVED_MODEL_FILENAME_PB
}
' "
+
$
"nor '
{
Constants
.
SAVED_MODEL_FILENAME_PBTXT
}
'."
)
;
}
var
obj
=
Loader
.
load
(
module_path
,
options
:
options
)
;
return
obj
;
}
public
static
string
resolve
(
string
handle
)
{
return
MultiImplRegister
.
GetResolverRegister
(
)
.
Call
(
handle
)
;
}
}
}
Back
|
FazBrowse Home
|
New Git URL