AttributeError: 'Module List' object has no attribute 'module' - DA-GAN

username: Hanen_Dh
cooked: <p>Hello, i used this cmd: python main.py --save_results --save_gt --save_models --cpu --n_GPUs 0 but this is the error : AttributeError: ‘Module List’ object has no attribute ‘module’; How can i solve it please, i don’t have GPU, just CPU…<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/a/8/a8c00000e4b00688dc0a8de775ed546355f0a088.png" data-download-href="https://discuss.pytorch.org/uploads/default/a8c00000e4b00688dc0a8de775ed546355f0a088" title="image"><img src="https://discuss.pytorch.org/uploads/default/original/3X/a/8/a8c00000e4b00688dc0a8de775ed546355f0a088.png" alt="image" data-base62-sha1="o4PzxfRi8Vuo2Ar9IWfWRtUOc3e" width="690" height="177" data-dominant-color="F9F9F7"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">image</span><span class="informations">697×179 11.9 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>

username: ptrblck
cooked: <p>As the error states, <code>nn.ModuleList</code> doesn’t have the <code>.module</code> attribute, which is an attribute of a data parallel wrapper. I’m not sure what your code tries to do so could you explain your use case a bit more?</p>

username: Hanen_Dh
cooked: <p>I have a code that’s not running , might be pytorch version issue … can you help me?</p>

username: ptrblck
cooked: <p>The mentioned issue is not caused by different PyTorch versions, but would be a wrong usage of the <code>.module</code> attribute.<br>
Sure, please describe the issue in more detail and, if possible, post a minimal, executable code snippet so that we could debug it.</p>

username: Hanen_Dh
cooked: <p>the error is in line 518 the last line , in __getattr__type(self).<strong>name</strong>, name)):<br>
AttributeError: ‘ModuleList’ object has no attribute ‘module’<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/d/6/d6c6d45129f2045ff33108a132031d2fec6e74c5.png" data-download-href="https://discuss.pytorch.org/uploads/default/d6c6d45129f2045ff33108a132031d2fec6e74c5" title="image"><img src="https://discuss.pytorch.org/uploads/default/original/3X/d/6/d6c6d45129f2045ff33108a132031d2fec6e74c5.png" alt="image" data-base62-sha1="uE0asbveoR3c6aH0QTFSgMoxsZn" width="690" height="292" data-dominant-color="222B34"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">image</span><span class="informations">841×357 12.1 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>
<pre><code class="lang-auto">    def __getattr__(self, name):
        if '_parameters' in self.__dict__:
            _parameters = self.__dict__['_parameters']
            if name in _parameters:
                return _parameters[name]
        if '_buffers' in self.__dict__:
            _buffers = self.__dict__['_buffers']
            if name in _buffers:
                return _buffers[name]
        if '_modules' in self.__dict__:
            modules = self.__dict__['_modules']
            if name in modules:
                return modules[name]
        raise AttributeError("'{}' object has no attribute '{}'".format(
            type(self).__name__, name)) #this is the error
</code></pre>

username: ptrblck
cooked: <p>Unfortunately I don’t have any context to be able to help more. As previously explained, <code>nn.ModuleList</code> doesn’t have this attribute and I don’t know how you are using this object or why the <code>modules</code> attribute is accessed.</p>