Skip to content
This repository was archived by the owner on Dec 11, 2023. It is now read-only.

Pr fix interop threads #420

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions nmt/nmt.py
Original file line number Diff line number Diff line change
Expand Up @@ -620,10 +620,6 @@ def run_main(flags, default_hparams, train_fn, inference_fn, target_session=""):
num_workers = flags.num_workers
utils.print_out("# Job id %d" % jobid)

# GPU device
utils.print_out(
"# Devices visible to TensorFlow: %s" % repr(tf.Session().list_devices()))

# Random
random_seed = flags.random_seed
if random_seed is not None and random_seed > 0:
Expand Down Expand Up @@ -653,6 +649,14 @@ def run_main(flags, default_hparams, train_fn, inference_fn, target_session=""):
out_dir, default_hparams, flags.hparams_path,
save_hparams=(jobid == 0))

# GPU device
config_proto = utils.get_config_proto(
allow_soft_placement=True,
num_intra_threads=hparams.num_intra_threads,
num_inter_threads=hparams.num_inter_threads)
utils.print_out(
"# Devices visible to TensorFlow: %s" % repr(tf.Session(config=config_proto).list_devices()))

## Train / Decode
if flags.inference_input_file:
# Inference output directory
Expand Down