Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
N
nrp-axo
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
Melissa Quinnan
nrp-axo
Commits
6a4b4ecf
Commit
6a4b4ecf
authored
1 month ago
by
dc250601
Browse files
Options
Downloads
Patches
Plain Diff
test1
parent
f7d4e95e
No related branches found
No related tags found
1 merge request
!1
Main
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
contrastive_vae_tuner.py
+2
-10
2 additions, 10 deletions
contrastive_vae_tuner.py
with
2 additions
and
10 deletions
contrastive_vae_tuner.py
+
2
−
10
View file @
6a4b4ecf
...
...
@@ -27,16 +27,8 @@ import random
import
gc
import
argparse
# Ensure PyTorch does NOT use GPUs
os
.
environ
[
"
CUDA_VISIBLE_DEVICES
"
]
=
"
-1
"
# This disables CUDA for PyTorch
torch_device
=
torch
.
device
(
"
cpu
"
)
# Explicitly set PyTorch to CPU
# Ensure TensorFlow CAN use GPUs
os
.
environ
[
"
TF_FORCE_GPU_ALLOW_GROWTH
"
]
=
"
true
"
# Optional: Prevent TF from using all memory
tf_device
=
tf
.
config
.
list_physical_devices
(
"
GPU
"
)
# Check available GPUs
# Debugging Output
print
(
f
"
PyTorch device:
{
torch_device
}
"
)
print
(
f
"
TensorFlow devices:
{
tf_device
}
"
)
# Should list GPU(s)
def
distance
(
model
,
data
):
...
...
@@ -60,7 +52,7 @@ def run(config):
tf
.
config
.
experimental
.
enable_op_determinism
()
####################################################################
gpus
=
tf
.
config
.
experimental
.
list_physical_devices
(
'
C
PU
'
)
gpus
=
tf
.
config
.
experimental
.
list_physical_devices
(
'
G
PU
'
)
if
gpus
:
try
:
for
gpu
in
gpus
:
...
...
@@ -347,6 +339,6 @@ if __name__ == '__main__':
search_alg
=
optuna_search
,
scheduler
=
scheduler
,
num_samples
=
1000
,
resources_per_trial
=
{
'
cpu
'
:
8
,
'
gpu
'
:
1
/
4
},
resources_per_trial
=
{
'
cpu
'
:
2
,
'
gpu
'
:
1
/
4
},
)
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