Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
FreeForestML
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CERN
fsauerbu
FreeForestML
Commits
e5d7b5b1
Commit
e5d7b5b1
authored
2 years ago
by
Ahmed Markhoos
Browse files
Options
Downloads
Patches
Plain Diff
fix package/module import
parent
4ff10f82
No related branches found
Branches containing commit
No related tags found
1 merge request
!74
HepNetSearch Implementation
Pipeline
#12742
failed
2 years ago
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
freeforestml/model.py
+6
-4
6 additions, 4 deletions
freeforestml/model.py
with
6 additions
and
4 deletions
freeforestml/model.py
+
6
−
4
View file @
e5d7b5b1
...
...
@@ -5,10 +5,12 @@ import sys
import
h5py
import
json
import
socket
import
multiprocessing
as
mp
import
numpy
as
np
import
pandas
as
pd
import
tensorflow
as
tf
import
keras_tuner
from
freeforestml.variable
import
Variable
from
freeforestml.helpers
import
python_to_str
,
str_to_python
...
...
@@ -823,7 +825,7 @@ class HepNet:
self
.
history
.
to_hdf
(
path
,
"
history
"
)
@classmethod
def
load
(
cls
,
path
):
def
load
(
cls
,
path
,
**
kwds
):
"""
Restore a model from a hdf5 file.
"""
...
...
@@ -869,7 +871,7 @@ class HepNet:
with
h5py
.
File
(
path
,
"
r
"
)
as
input_file
:
for
fold_i
in
range
(
cv
.
k
):
path_token
=
instance
.
_get_model_path
(
path
,
fold_i
)
model
=
tf
.
keras
.
models
.
load_model
(
path_token
)
model
=
tf
.
keras
.
models
.
load_model
(
path_token
,
**
kwds
)
instance
.
models
.
append
(
model
)
# load normalizer
...
...
@@ -1303,9 +1305,9 @@ class tuner_mp(object):
print
(
"
Fold:%s
\t
ID:%s IP:%s PORT:%s
"
%
(
fold_i
,
os
.
getenv
(
"
KERASTUNER_TUNER_ID
"
),
os
.
getenv
(
"
KERASTUNER_ORACLE_IP
"
),
os
.
getenv
(
"
KERASTUNER_ORACLE_PORT
"
)))
#Constrain memory growth on physical GPUs
physical_devices
=
t
ensorflow
.
config
.
list_physical_devices
(
'
GPU
'
)
physical_devices
=
t
f
.
config
.
list_physical_devices
(
'
GPU
'
)
try
:
t
ensorflow
.
config
.
experimental
.
set_memory_growth
(
physical_devices
[
0
],
True
)
t
f
.
config
.
experimental
.
set_memory_growth
(
physical_devices
[
0
],
True
)
except
:
# In case of CPU or virtual devices
pass
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment