当我尝试关闭url(r'followpopularnewsprovider/(?P<user_id>\d+)/$',
csrf_exempt(views.GetMobilefollowpopularnewsproviderTest), name='popularprovider')
中的SummaryWriter
时,程序无法退出(打印'closed')。
__del__()
如果from torch.utils.tensorboard import SummaryWriter
class Test:
def __init__(self):
self.tblog = SummaryWriter('exp/tb/exit_test')
# self.tblog.close()
def __del__(self):
self.tblog.close()
print('closed')
if __name__ == '__main__':
tblog = Test()
不在close()
中,则程序可以退出。
Python 3.7.5
Pytorch 1.3.1
tensorboard 2.0.0
操作系统:Ubuntu和Win10