windofshadow / THAT

Code for AAAI paper "Two-Stream Convolution Augmented Transformer for Human Activity Recognition"
99 stars 24 forks source link

the problem about the dataset #3

Open Tom-Teamo opened 2 years ago

Tom-Teamo commented 2 years ago

In "transformer-csi.py", there is parser.add_argument('--dataset', type=str, default='53001_npy', help='dataset'). I am confused by "53001_npy", and I wonder whether the dataset(https://drive.google.com/file/d/19uH0_z1MBLtmMLh8L4BlNA0w-XAFKipM/view) is in 53001_npy folder? By the way, I think that "load_public_data.py" is used to torch.save(data, "Data.pt"), right? If I run this script, does it mean that I do not need to run below IF segment of "transformer-csi.py", because I already hava "Data.pt" after running.

def load_data(root):
    if root.find("npy") != -1:
        root = root + '\\'
        file_list = os.listdir(root)
        label = []
        data = []
        aclist = ['empty', 'jump', 'pick', 'run', 'sit', 'walk', 'wave']
        for file in file_list:
            file_name = root + file
            csi = np.load(file_name)
            csi = torch.from_numpy(csi).float().unsqueeze(0)  # 1*2000*3*30
            csi.requires_grad = False
            csi = csi.view(1, 2000, 90)
            data.append(csi)
            for j in range(len(aclist)):
                if file.find(aclist[j]) != -1:
                    label.append(j)
                    break
        data = torch.cat(data, dim=0)
        label = torch.tensor(label)
        data = Data.TensorDataset(data, label)
        args.category = len(aclist)
    else:
        data = torch.load("Data.pt")
        aclist = ['bed', 'fall', 'pickup', 'run', 'sitdown', 'standup', 'walk']
    return data, aclist
halbupt commented 1 year ago

Hey, have you got the Data.pt after running the 'load_public_data.py'

Tom-Teamo commented 1 year ago

Hey, have you got the Data.pt after running the 'load_public_data.py'

no...

halbupt commented 1 year ago

Hey, have you got the Data.pt after running the 'load_public_data.py'

no...

I just got it!, Just refer my answers in the third issue 'load_public_data.py'.

1685025407061
halbupt commented 1 year ago

The code can be run normally,

1685027341173
n830024282 commented 8 months ago

The code can be run normally, 1685027341173

load_data Have you encountered the problem of tensor size inconsistency? Do you know how to solve the problem?

n830024282 commented 8 months ago

@halbupt