'str' object is not callable

username: 111186
cooked: <p><div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/8/b/8b6ba9f19361d9514a6de79f3d893c6aaddcd408.png" data-download-href="https://discuss.pytorch.org/uploads/default/8b6ba9f19361d9514a6de79f3d893c6aaddcd408" title=")%7DL)8F2%7B%7DC5JKOTF~7Z1G%7B0"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/8/b/8b6ba9f19361d9514a6de79f3d893c6aaddcd408_2_690x219.png" alt=")%7DL)8F2%7B%7DC5JKOTF~7Z1G%7B0" data-base62-sha1="jTn2iEzCMFiHWuqmLk4AMdseTHi" width="690" height="219" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/8/b/8b6ba9f19361d9514a6de79f3d893c6aaddcd408_2_690x219.png, https://discuss.pytorch.org/uploads/default/optimized/3X/8/b/8b6ba9f19361d9514a6de79f3d893c6aaddcd408_2_1035x328.png 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/8/b/8b6ba9f19361d9514a6de79f3d893c6aaddcd408_2_1380x438.png 2x" data-dominant-color="353431"><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">)%7DL)8F2%7B%7DC5JKOTF~7Z1G%7B0</span><span class="informations">2663×849 273 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>
<p>it shows the error is ‘str’ object is not callable ,but i check i don’t use redefine str, so i don’t know how to solve this problem .</p>

username: albanD
cooked: <p>I would guess that one of your transform is just a string instead of being a module?</p>

username: 111186
cooked: <p>thank you very much， but i don’t konw what your means, can you explain more deatials ,thanks again</p>

username: huoge
cooked: <p>it seems like t in ‘img = t(img)’ is not a module, it may be just a string</p>

username: 111186
cooked: <p><div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/3/a/3a8b495ac0e79d8804eb59d3b303472d0fccecb5.png" data-download-href="https://discuss.pytorch.org/uploads/default/3a8b495ac0e79d8804eb59d3b303472d0fccecb5" title="%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20191220153730"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/3/a/3a8b495ac0e79d8804eb59d3b303472d0fccecb5_2_690x355.png" alt="%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20191220153730" data-base62-sha1="8lU71CgmhFnfDMAcUDASi17TuK1" width="690" height="355" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/3/a/3a8b495ac0e79d8804eb59d3b303472d0fccecb5_2_690x355.png, https://discuss.pytorch.org/uploads/default/optimized/3X/3/a/3a8b495ac0e79d8804eb59d3b303472d0fccecb5_2_1035x532.png 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/3/a/3a8b495ac0e79d8804eb59d3b303472d0fccecb5_2_1380x710.png 2x" data-dominant-color="2D2F27"><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">%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20191220153730</span><span class="informations">1603×825 80.4 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><br>
thank you for your answer, this is the code in the picture ,it comes from transform.py. can you tell me how to solve this problem thank you very much</p>

username: huoge
cooked: <p>when you init the class Compose, the transforms should be a list of modules</p>

username: 111186
cooked: <p>thanks so much , this code "img = t(img)"it comes from pytoch, so i don’t think it will wrong. so i should check my init code? it wil be very thankful if you can tell me how to write the right code. those are pictures that i think use the init code. thanks again<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/9/8/98fec93f98399e0aa9c7d165b7e1ed3553073bd0.jpeg" data-download-href="https://discuss.pytorch.org/uploads/default/98fec93f98399e0aa9c7d165b7e1ed3553073bd0" title="11"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/9/8/98fec93f98399e0aa9c7d165b7e1ed3553073bd0_2_690x432.jpeg" alt="11" data-base62-sha1="lPss2vT7zapbdyNmxTfM9BifVvy" width="690" height="432" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/9/8/98fec93f98399e0aa9c7d165b7e1ed3553073bd0_2_690x432.jpeg, https://discuss.pytorch.org/uploads/default/optimized/3X/9/8/98fec93f98399e0aa9c7d165b7e1ed3553073bd0_2_1035x648.jpeg 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/9/8/98fec93f98399e0aa9c7d165b7e1ed3553073bd0_2_1380x864.jpeg 2x" data-dominant-color="2F2F29"><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">11</span><span class="informations">1935×1213 163 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> <div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/1/f/1f7e1ee91ef6f3833a220475b5992f98ebe21f6e.jpeg" data-download-href="https://discuss.pytorch.org/uploads/default/1f7e1ee91ef6f3833a220475b5992f98ebe21f6e" title="22"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/1/f/1f7e1ee91ef6f3833a220475b5992f98ebe21f6e_2_690x296.jpeg" alt="22" data-base62-sha1="4uB0RWtZr55KB2JxcrJw1Dv1GmG" width="690" height="296" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/1/f/1f7e1ee91ef6f3833a220475b5992f98ebe21f6e_2_690x296.jpeg, https://discuss.pytorch.org/uploads/default/optimized/3X/1/f/1f7e1ee91ef6f3833a220475b5992f98ebe21f6e_2_1035x444.jpeg 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/1/f/1f7e1ee91ef6f3833a220475b5992f98ebe21f6e_2_1380x592.jpeg 2x" data-dominant-color="31322A"><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">22</span><span class="informations">2387×1025 215 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: huoge
cooked: <p><div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/4/a/4a8cd9a2d349bf7b0a59e5d5891fcbe455a594e9.jpeg" data-download-href="https://discuss.pytorch.org/uploads/default/4a8cd9a2d349bf7b0a59e5d5891fcbe455a594e9" title="image"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/4/a/4a8cd9a2d349bf7b0a59e5d5891fcbe455a594e9_2_690x136.jpeg" alt="image" data-base62-sha1="aDv6nlzJ7iq8d0w7x9RtO0GalOF" width="690" height="136" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/4/a/4a8cd9a2d349bf7b0a59e5d5891fcbe455a594e9_2_690x136.jpeg, https://discuss.pytorch.org/uploads/default/optimized/3X/4/a/4a8cd9a2d349bf7b0a59e5d5891fcbe455a594e9_2_1035x204.jpeg 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/4/a/4a8cd9a2d349bf7b0a59e5d5891fcbe455a594e9_2_1380x272.jpeg 2x" data-dominant-color="313128"><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">1539×305 137 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><br>
delete the comments, it is regarded as a string. check transform_test too</p>

username: 111186
cooked: <p>i solve this problem,i am so happy. thanks again, but i don’t understand why it will be regraded as a string,<br>
“”" “”" it should be regarded as comment?.  Anyway  i am so appreciate for your help</p>

username: Eta_C
cooked: <p>Check out this <a href="https://www.codecademy.com/forum_questions/505ba3cfc6addb000200e33c?__cf_chl_captcha_tk__=0938205831f475f297fc602ccdee93ff42fe09a0-1576832012-0-AezGO0qqHd0GbvQY95esaUNWH7inPiRxgxAjWJh6_fmrCXFmkaUft5qaDKtJN9ihcWdPnbnG4TGIz-oTSa3Bev_H3sPxpefvr990F_dmz4KAnAzJxc5STLj6ZPqJMBcI08nrCZCWPM9nZ79QCdb15XUm2lkD1__AoYvU-4BGxHribpJA9pB4pgkZp-wRC6whzOpEl0J43YHAePddqN31t48jb0Ib6XN5-tj6o5Jc-E2_s5ewP-7CNfMhWAouhfOFLtqILh-MBZW4dLD-PyB2fDsT_sfGKI3D5px09AOxBDFK28TZp5Rr011AQUZbXPha-SXgKRP7yYKwonOoJ25JTTWqg0aj1CQIqkkq0WpM6rSBXdY1YAFFGbTLJow4QvNKMh5ZDU_CYewrHTdJdroKzcpBbgdtvVwi1fpYqiGMkw3T" rel="noopener nofollow ugc">link</a>.</p>
<blockquote>
<p>As part of the Python course it is taught that in order to do a multiline comment one should use  <code>"""triple quotes"""</code> . This is wrong. Python only has one way of doing comments and that is using  <code>#</code> .</p>
<p>Triple quotes are treated as regular strings with the exception that they can span multiple lines. By regular strings I mean that if they are not assigned to a variable they will be immediately garbage collected as soon as that code executes. hence are  <strong>not ignored</strong>  by the interpreter in the same way that  <code>#a comment</code>  is.</p>
<p>The only exception to the garbage collection fact is when they are placed immediately after a function or class definition or on top of a module, in which case they are called docstrings and made available via the special variable  <code>myobj.__doc__</code> .</p>
<p>Due to the existance of docstrings I’ve seen a lot of people confused about the use of  <code>"""</code>  elsewhere.</p>
<p>I suggest that the multiline comment lesson is removed or replaced with the instructions from the official <a href="http://www.python.org/dev/peps/pep-0008/#block-comments" rel="noopener nofollow ugc">PEP8 - Block comments section</a>.</p>
</blockquote>
<p><strong>Python only has one way of doing comments and that is using   <code>#</code>  .</strong></p>

username: 111186
cooked: <p>got it , thanks so much</p>