查看数据居然有这操作  batchsize维度后  clips[0].shape

前提用的是pytorch的框架,用的是ipdb查看数据的方法,ipdb是非常有作用的一种调试工具。再次,博主再次简单讲解一下ipdb的方法,先import ipdb, 在想看数据的地方发,打上ipdb.set_trace(),然后程序编译没有错误的话,执行到这里会断掉,然后输入你想看的数据。

        这里输入n,是下一行的意思next;

        输入r是执行到下一个ipdb.set_trace()

        输入l 是看这行代码上下的共十行代码。

我们知道不同的Type的数据对应的查看的方法是不一样的。

python简单看数据的方法

对于一个pandas工具包读入的数据,train_lst.index的结果是可以看到数据共有多少行,可以从截图中看到train_lst.index = RangeIndex(start=0, stop=190534,step=1), train_lst.columns 数据有哪些列是Index([u'clip_name', f'frame_name',u'start_frame',u'label'] , dtype ='object') ,  train_lst.head() 返回数据的前三行。

train_lst.dtypes =

clip_name   object

frame_name  object

start_frame  int64

label  int64


python简单看数据的方法对于一个tuple的对象,可以看到current_data.shape = (42, 3, 8, 128, 128),  len(current_data) = 42



python简单看数据的方法对于一个Variable对象 current_data.size()=(42,3,8,128,128), len(current_data)=42


其中对于list对象(clips 在这里是list对象)查看数据的维度用的方法是np.array(clips).shape

相关文章:

  • 2021-11-19
  • 2021-04-08
  • 2021-06-29
  • 2021-12-04
  • 2022-01-14
  • 2022-12-23
  • 2021-11-18
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-29
  • 2022-12-23
  • 2021-11-05
  • 2021-12-12
  • 2021-10-12
相关资源
相似解决方案