We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have been having some blocking issues. I isolated the problem in this 30 lines code:
import numpy as np import torch from torchsummary import summary import torch.multiprocessing as mp from torch.nn import functional as F class MyModel(torch.nn.Module): def __init__(self): super(MyModel, self).__init__() self.l1 = torch.nn.Linear(64, 100) self.last = torch.nn.Linear(100, 4) def forward(self,x): y = F.relu(self.l1(x)) result = F.log_softmax(self.last(y),dim=0) return result def worker(t, worker_model): state = torch.from_numpy(np.random.rand(1, 64)).float() value = worker_model(state) print ("Never arrive here") model = MyModel() model.share_memory() #summary(model, (1,64)) p = mp.Process(target=worker, args=(0, model)) p.start() p.join()
If you uncomment the 'summary' line, the worker function will be blocked in the call to worker_model(state).
worker_model(state)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I have been having some blocking issues. I isolated the problem in this 30 lines code:
If you uncomment the 'summary' line, the worker function will be blocked in the call to
worker_model(state)
.The text was updated successfully, but these errors were encountered: