Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- RuntimeError Traceback (most recent call last)
- <ipython-input-6-65cf6c4890a8> in <module>()
- 3
- 4 nuts_kernel = NUTS(model, max_tree_depth=5)
- ----> 5 posterior = MCMC(nuts_kernel, num_samples=500, warmup_steps=2000, num_chains=5).run(x, y)
- 6
- 7 mw1 = EmpiricalMarginal(posterior, sites=["module$$$fc1_mean.weight"])._get_samples_and_weights()[0].cpu().detach().numpy()
- ~/anaconda3/lib/python3.6/site-packages/pyro/infer/abstract_infer.py in run(self, *args, **kwargs)
- 221 self._reset()
- 222 with poutine.block():
- --> 223 for i, vals in enumerate(self._traces(*args, **kwargs)):
- 224 if len(vals) == 2:
- 225 chain_id = 0
- ~/anaconda3/lib/python3.6/site-packages/pyro/infer/mcmc/mcmc.py in _traces(self, *args, **kwargs)
- 266
- 267 def _traces(self, *args, **kwargs):
- --> 268 for sample in self.sampler._traces(*args, **kwargs):
- 269 yield sample
- 270
- ~/anaconda3/lib/python3.6/site-packages/pyro/infer/mcmc/mcmc.py in _traces(self, *args, **kwargs)
- 160 while active_workers:
- 161 try:
- --> 162 chain_id, val = self.result_queue.get(timeout=5)
- 163 self.events[chain_id].set()
- 164 except queue.Empty:
- ~/anaconda3/lib/python3.6/multiprocessing/queues.py in get(self, block, timeout)
- 111 self._rlock.release()
- 112 # unserialize the data after having released the lock
- --> 113 return _ForkingPickler.loads(res)
- 114
- 115 def qsize(self):
- ~/anaconda3/lib/python3.6/site-packages/torch/multiprocessing/reductions.py in rebuild_storage_fd(cls, df, size)
- 274 fd = multiprocessing.reduction.rebuild_handle(df)
- 275 else:
- --> 276 fd = df.detach()
- 277 try:
- 278 storage = storage_from_cache(cls, fd_id(fd))
- ~/anaconda3/lib/python3.6/multiprocessing/resource_sharer.py in detach(self)
- 56 '''Get the fd. This should only be called once.'''
- 57 with _resource_sharer.get_connection(self._id) as conn:
- ---> 58 return reduction.recv_handle(conn)
- 59
- 60
- ~/anaconda3/lib/python3.6/multiprocessing/reduction.py in recv_handle(conn)
- 180 '''Receive a handle over a local connection.'''
- 181 with socket.fromfd(conn.fileno(), socket.AF_UNIX, socket.SOCK_STREAM) as s:
- --> 182 return recvfds(s, 1)[0]
- 183
- 184 def DupFd(fd):
- ~/anaconda3/lib/python3.6/multiprocessing/reduction.py in recvfds(sock, size)
- 159 if len(ancdata) != 1:
- 160 raise RuntimeError('received %d items of ancdata' %
- --> 161 len(ancdata))
- 162 cmsg_level, cmsg_type, cmsg_data = ancdata[0]
- 163 if (cmsg_level == socket.SOL_SOCKET and
- RuntimeError: received 0 items of ancdata
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement