Skip to content

Commit

Permalink
Removed gran from importing; Removed queue.empty check for mp; Fixed …
Browse files Browse the repository at this point in the history
…some typos
  • Loading branch information
haozhu233 committed Oct 6, 2021
1 parent d5aa699 commit 8ef4507
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.ipynb_checkpoints/
__pycache__/
*.pyc

2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from models.dgmg.data import Graph_to_Action
from models.gcn.helper import legal_perms_sampler, mp_sampler
from models.graphgen.helper import dfscode_to_tensor
from models.gran.data import GRANData
# from models.gran.data import GRANData

from model import create_models
from train import train
Expand Down
2 changes: 1 addition & 1 deletion model.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from models.graph_rnn.model import create_model as create_model_graph_rnn
from models.gcn.model import create_model as create_model_gcn
from models.graphgen.model import create_model as create_model_graphgen
from models.gran.model import create_model as create_model_gran
# from models.gran.model import create_model as create_model_gran
from utils import load_model, get_last_checkpoint


Expand Down
8 changes: 5 additions & 3 deletions models/gcn/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import torch.nn.functional as F
import torch.multiprocessing as multiprocessing
import itertools
from torch._six import queue
# from torch._six import queue
from torch.utils.data._utils.worker import ManagerWatchdog
from torch.utils.data._utils import MP_STATUS_CHECK_INTERVAL, python_exit_status
from torch.distributions.distribution import Distribution
Expand Down Expand Up @@ -249,7 +249,8 @@ def worker_loop(index_queue, data_queue, done_event):
while watchdog.is_alive():
try:
r = index_queue.get(timeout=MP_STATUS_CHECK_INTERVAL)
except queue.Empty:
except:
# except queue.Empty:
continue
if r is None:
# Received the final signal
Expand Down Expand Up @@ -282,7 +283,8 @@ def worker_loop_vf2(index_queue, data_queue, done_event):
while watchdog.is_alive():
try:
r = index_queue.get(timeout=MP_STATUS_CHECK_INTERVAL)
except queue.Empty:
except:
# except queue.Empty:
continue
if r is None:
# Received the final signal
Expand Down
2 changes: 1 addition & 1 deletion train.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from models.gcn.helper import legal_perms_sampler
from models.graph_rnn.train import evaluate_loss as eval_loss_graph_rnn
from models.dgmg.train import evaluate_loss as eval_loss_dgmg
from models.gran.model import evaluate_loss as eval_loss_gran
# from models.gran.model import evaluate_loss as eval_loss_gran
from models.graphgen.train import evaluate_loss as eval_loss_graphgen
from torch.utils.data._utils.collate import default_collate as collate

Expand Down

0 comments on commit 8ef4507

Please sign in to comment.