RuntimeError: Function MmBackward returned an invalid gradient at index 0 - got [5, 2048] but expected shape compatible with [5, 4096]
这个问题是在定义的时候出错
比如代码
self.fc = nn.Linear(2048, 2048) 这是错误的
改成 self.fc = nn.Linear(4096, 2048)
RuntimeError: Function MmBackward returned an invalid gradient at index 0 - got [5, 2048] but expected shape compatible with [5, 4096]
这个问题是在定义的时候出错
比如代码
self.fc = nn.Linear(2048, 2048) 这是错误的
改成 self.fc = nn.Linear(4096, 2048)