Terminate called without an active exception when using Dataparallele

username: Imene.b
cooked: <p>when i train my neural network using Dataparallel of pytorch  this error appears<br>
terminate called without an active exception<br>
Aborted (core dumped)<br>
the instruction which cause the error is :<br>
network = DataParallel(network, chunk_sizes= list_chunk_sizes)<br>
list_chunk_sizes = [4, 5,5,5,5,5,5,5,5,5]<br>
batch_size = 49<br>
any one can help me?</p>

username: ptrblck
cooked: <p>Are you using <code>nn.DataParallel</code>, as the <code>chunk_sizes</code> argument shouldn’t be defined?<br>
Could you explain, what this argument does (in this custom implementation)?</p>

username: Imene.b
cooked: <p>yes i am using torch.nn.Dataparallel to train network in parallel</p>

username: Imene.b
cooked: <p>rst forgive my language because i dont speek english<br>
i use batch size = 49 then i divide it in 10 sub batchez, each have a size folloing this list [4, 5,5,5,5,5,5,5,5,5]<br>
and when the model train the network, the images are feed to the network based on the list of chunk sizes<br>
its for doing parallelliszme if you have + then 1 GPU card</p>

username: ptrblck
cooked: <p>Thanks for the explanation.<br>
Did you write the <code>DataParallel</code> class yourself or are you using a specific implementation from another repository?<br>
The native <code>nn.DataParallel</code> class shouldn’t take <code>chunk_sizes</code> as its argument, so I’m just wondering which implementation you are using.</p>

username: Imene.b
cooked: <p>aah yes<br>
it is an implementation from CornerNet, algorithm for detection of object in images<br>
the problem in this error is that sometimes it dont appear<br>
and where should i put chunk sizes, if it is not the correct place</p>

username: ptrblck
cooked: <p>I’m not familiar with this implementation, so could you post a link to it, please?<br>
Also, could you use <code>nn.DataParallel</code> and check, if you are running into the same error?</p>

username: Imene.b
cooked: <p>the link to cornernet is:</p>
<p><img src="https://github.githubassets.com/favicons/favicon.svg" alt="" width="16" height="16"> <a href="https://github.com/princeton-vl/CornerNet" rel="nofollow noopener">GitHub</a></p>
<p><img src="https://avatars2.githubusercontent.com/u/29677746?s=400&amp;v=4" alt="" width="60" height="60"></p>
<h3><a href="https://github.com/princeton-vl/CornerNet" rel="nofollow noopener">princeton-vl/CornerNet</a></h3>
<p>Contribute to princeton-vl/CornerNet development by creating an account on GitHub.</p>
<p>you can find this implementation in CornerNet-master/nnet/py_factory.py<br>
There is part of this code:<br>
class NetworkFactory(object):<br>
def <strong>init</strong>(self, db):</p>
<pre><code>    super(NetworkFactory, self).__init__()

    module_file = "models.{}".format(system_configs.snapshot_name)
    nnet_module = importlib.import_module(module_file)
    self.model   = DummyModule(nnet_module.model(db))
    self.loss    = nnet_module.loss
    self.network = Network(self.model, self.loss)
  
    self.network = DataParallel(self.network,chunk_sizes=system_configs.chunk_sizes )
    total_params = 0
    for params in self.model.parameters():
        num_params = 1
        for x in params.size():
            num_params *= x                              
        total_params += num_params    
    print("total parameters: {}".format(total_params))
    if system_configs.opt_algo == "adam":
        self.optimizer = torch.optim.Adam(
            filter(lambda p: p.requires_grad, self.model.parameters())</code></pre>