Thank you! If I delete the plotting part listed below, It works! But if I include them, there is a ValueError: ValueError: only one element tensors can be converted to Python scalars
    prediction_list_plot=np.array(prediction_list)
    plt.plot(test_y_np.flatten(),'r-',linewidth=0.1,label='real data')
    plt.plot(prediction_list_plot.flatten(),'b-',linewidth=0.1,label='predicted data')
    plt.show()

The complete error is like this:
Epoch 1 Train Loss:160.0811848245794, Test Loss:6.106114995200187
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
ValueError: only one element tensors can be converted to Python scalars

The above exception was the direct cause of the following exception:

SystemError                               Traceback (most recent call last)
<ipython-input-18-cd9cea2f2ee0> in <module>
     96     prediction_list_plot=np.array(prediction_list)
     97     plt.plot(test_y_np.flatten(),'r-',linewidth=0.1,label='real data')
---> 98     plt.plot(prediction_list_plot.flatten(),'b-',linewidth=0.1,label='predicted data')
     99     plt.show()
    100 print('Finish training')

D:\Anaconda3\lib\site-packages\matplotlib\pyplot.py in plot(*args, **kwargs)
   3361                       mplDeprecation)
   3362     try:
-> 3363         ret = ax.plot(*args, **kwargs)
   3364     finally:
   3365         ax._hold = washold

D:\Anaconda3\lib\site-packages\matplotlib\__init__.py in inner(ax, *args, **kwargs)
   1865                         "the Matplotlib list!)" % (label_namer, func.__name__),
   1866                         RuntimeWarning, stacklevel=2)
-> 1867             return func(ax, *args, **kwargs)
   1868 
   1869         inner.__doc__ = _add_data_doc(inner.__doc__,

D:\Anaconda3\lib\site-packages\matplotlib\axes\_axes.py in plot(self, *args, **kwargs)
   1527 
   1528         for line in self._get_lines(*args, **kwargs):
-> 1529             self.add_line(line)
   1530             lines.append(line)
   1531 

D:\Anaconda3\lib\site-packages\matplotlib\axes\_base.py in add_line(self, line)
   1958             line.set_clip_path(self.patch)
   1959 
-> 1960         self._update_line_limits(line)
   1961         if not line.get_label():
   1962             line.set_label('_line%d' % len(self.lines))

D:\Anaconda3\lib\site-packages\matplotlib\axes\_base.py in _update_line_limits(self, line)
   1980         Figures out the data limit of the given line, updating self.dataLim.
   1981         """
-> 1982         path = line.get_path()
   1983         if path.vertices.size == 0:
   1984             return

D:\Anaconda3\lib\site-packages\matplotlib\lines.py in get_path(self)
    954         """
    955         if self._invalidy or self._invalidx:
--> 956             self.recache()
    957         return self._path
    958 

D:\Anaconda3\lib\site-packages\matplotlib\lines.py in recache(self, always)
    655         if always or self._invalidy:
    656             yconv = self.convert_yunits(self._yorig)
--> 657             y = _to_unmasked_float_array(yconv).ravel()
    658         else:
    659             y = self._y

D:\Anaconda3\lib\site-packages\matplotlib\cbook\__init__.py in _to_unmasked_float_array(x)
   2050         return np.ma.asarray(x, float).filled(np.nan)
   2051     else:
-> 2052         return np.asarray(x, float)
   2053 
   2054 

D:\Anaconda3\lib\site-packages\numpy\core\numeric.py in asarray(a, dtype, order)
    480 
    481     """
--> 482     return array(a, dtype, copy=False, order=order)
    483 
    484 def asanyarray(a, dtype=None, order=None):

SystemError: <built-in method __float__ of Tensor object at 0x00000140EF486558> returned a result with an error set