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 .
I would guess that one of your transform is just a string instead of being a module?
thank you very much, but i don’t konw what your means, can you explain more deatials ,thanks again
it seems like t in ‘img = t(img)’ is not a module, it may be just a string
when you init the class Compose, the transforms should be a list of modules
i solve this problem,i am so happy. thanks again, but i don’t understand why it will be regraded as a string,
“”" “”" it should be regarded as comment?. Anyway i am so appreciate for your help
Check out this link.
As part of the Python course it is taught that in order to do a multiline comment one should use
"""triple quotes""". This is wrong. Python only has one way of doing comments and that is using#.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 not ignored by the interpreter in the same way that
#a commentis.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
myobj.__doc__.Due to the existance of docstrings I’ve seen a lot of people confused about the use of
"""elsewhere.I suggest that the multiline comment lesson is removed or replaced with the instructions from the official PEP8 - Block comments section.
Python only has one way of doing comments and that is using # .
got it , thanks so much




