cmhungsteve / SSTDA

[CVPR 2020] Action Segmentation with Joint Self-Supervised Temporal Domain Adaptation (PyTorch)

Home Page:https://arxiv.org/abs/2003.02824

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is there a demo ?

wwdok opened this issue · comments

Hi, @cmhungsteve , today i heard about action segmentation, and i feel interested in it, so i searched it in Github, then i find this great repo, is there a demo or method so that i can have a quick and intuitive sense about action segmentation ? Thanks !

I try to run one of those bash scripts, but i came across below error :

(base) user@user-TUF-Gaming-FX506LU-FX506LU:~/Repo/SSTDA$ bash run_gtea_SSTDA.sh
use_target: uSv, dataset: gtea
split: 1
Traceback (most recent call last):
  File "main.py", line 169, in <module>
    device, sample_rate, args)
  File "/home/user/Repo/SSTDA/predict.py", line 25, in predict
    model.load_state_dict(torch.load(model_dir + "/epoch-" + str(epoch) + ".model"))
  File "/home/user/miniconda3/lib/python3.7/site-packages/torch/serialization.py", line 581, in load
    with _open_file_like(f, 'rb') as opened_file:
  File "/home/user/miniconda3/lib/python3.7/site-packages/torch/serialization.py", line 230, in _open_file_like
    return _open_file(name_or_buffer, mode)
  File "/home/user/miniconda3/lib/python3.7/site-packages/torch/serialization.py", line 211, in __init__
    super(_open_file, self).__init__(open(name, mode))
FileNotFoundError: [Errno 2] No such file or directory: './Models_SSTDA/action-segmentation-DA/gtea/split_1/epoch-50.model'
Traceback (most recent call last):
  File "eval.py", line 150, in <module>
    main()
  File "eval.py", line 122, in main
    recog_content = read_file(recog_file).split('\n')[1].split()
  File "eval.py", line 7, in read_file
    with open(path, 'r') as f:
FileNotFoundError: [Errno 2] No such file or directory: './Results_SSTDA/action-segmentation-DA/gtea/split_1/S1_Cheese_C1'
split: 2
Traceback (most recent call last):
  File "main.py", line 169, in <module>
    device, sample_rate, args)
  File "/home/user/Repo/SSTDA/predict.py", line 25, in predict
    model.load_state_dict(torch.load(model_dir + "/epoch-" + str(epoch) + ".model"))
  File "/home/user/miniconda3/lib/python3.7/site-packages/torch/serialization.py", line 581, in load
    with _open_file_like(f, 'rb') as opened_file:
  File "/home/user/miniconda3/lib/python3.7/site-packages/torch/serialization.py", line 230, in _open_file_like
    return _open_file(name_or_buffer, mode)
  File "/home/user/miniconda3/lib/python3.7/site-packages/torch/serialization.py", line 211, in __init__
    super(_open_file, self).__init__(open(name, mode))
FileNotFoundError: [Errno 2] No such file or directory: './Models_SSTDA/action-segmentation-DA/gtea/split_2/epoch-50.model'
Traceback (most recent call last):
  File "eval.py", line 150, in <module>
    main()
  File "eval.py", line 122, in main
    recog_content = read_file(recog_file).split('\n')[1].split()
  File "eval.py", line 7, in read_file
    with open(path, 'r') as f:
FileNotFoundError: [Errno 2] No such file or directory: './Results_SSTDA/action-segmentation-DA/gtea/split_2/S2_Cheese_C1'
split: 3
Traceback (most recent call last):
  File "main.py", line 169, in <module>
    device, sample_rate, args)
  File "/home/user/Repo/SSTDA/predict.py", line 25, in predict
    model.load_state_dict(torch.load(model_dir + "/epoch-" + str(epoch) + ".model"))
  File "/home/user/miniconda3/lib/python3.7/site-packages/torch/serialization.py", line 581, in load
    with _open_file_like(f, 'rb') as opened_file:
  File "/home/user/miniconda3/lib/python3.7/site-packages/torch/serialization.py", line 230, in _open_file_like
    return _open_file(name_or_buffer, mode)
  File "/home/user/miniconda3/lib/python3.7/site-packages/torch/serialization.py", line 211, in __init__
    super(_open_file, self).__init__(open(name, mode))
FileNotFoundError: [Errno 2] No such file or directory: './Models_SSTDA/action-segmentation-DA/gtea/split_3/epoch-50.model'
Traceback (most recent call last):
  File "eval.py", line 150, in <module>
    main()
  File "eval.py", line 122, in main
    recog_content = read_file(recog_file).split('\n')[1].split()
  File "eval.py", line 7, in read_file
    with open(path, 'r') as f:
FileNotFoundError: [Errno 2] No such file or directory: './Results_SSTDA/action-segmentation-DA/gtea/split_3/S3_Cheese_C1'
split: 4
Traceback (most recent call last):
  File "main.py", line 169, in <module>
    device, sample_rate, args)
  File "/home/user/Repo/SSTDA/predict.py", line 25, in predict
    model.load_state_dict(torch.load(model_dir + "/epoch-" + str(epoch) + ".model"))
  File "/home/user/miniconda3/lib/python3.7/site-packages/torch/serialization.py", line 581, in load
    with _open_file_like(f, 'rb') as opened_file:
  File "/home/user/miniconda3/lib/python3.7/site-packages/torch/serialization.py", line 230, in _open_file_like
    return _open_file(name_or_buffer, mode)
  File "/home/user/miniconda3/lib/python3.7/site-packages/torch/serialization.py", line 211, in __init__
    super(_open_file, self).__init__(open(name, mode))
FileNotFoundError: [Errno 2] No such file or directory: './Models_SSTDA/action-segmentation-DA/gtea/split_4/epoch-50.model'
Traceback (most recent call last):
  File "eval.py", line 150, in <module>
    main()
  File "eval.py", line 122, in main
    recog_content = read_file(recog_file).split('\n')[1].split()
  File "eval.py", line 7, in read_file
    with open(path, 'r') as f:
FileNotFoundError: [Errno 2] No such file or directory: './Results_SSTDA/action-segmentation-DA/gtea/split_4/S4_Cheese_C1'

How to get these missing files ?

It seems that the trained model is missing. If I were you, I will check two things first:

  1. I really trained and saved a model.
  2. the path of the saved model is correct.

Oh, i used to think this script used a pretained model, it turns out that the script will do training on the fly, now the script works correctly, thanks !