Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IsADirectoryError: [Errno 21] Is a directory: '../saved_models/conv1d_transformer_decoder_tts_joint' #2

Open
GO0108 opened this issue Oct 22, 2024 · 2 comments

Comments

@GO0108
Copy link

GO0108 commented Oct 22, 2024

Hello, I attempted to test the model by following the steps provided in etc/inference.ipynb. I downloaded the YoloStutter checkpoint from Google Drive, but it seems the code expects a .pt file or a similar format. Am I missing something here? Should I be using the pretrained VITS weights at this step?


IsADirectoryError Traceback (most recent call last)
Cell In[14], line 20
16 device = torch.device("cuda:0")
18 # decoder = Decoder(in_channels, out_channels, kernel_size, kernel_stride, num_blocks, num_classes, downsample_factor)
---> 20 decoder = torch.load("../saved_models/conv1d_transformer_decoder_tts_joint", map_location=device)
21 dataset = Dataset(
22 "../stutter_VCTK_joint/", hps, downsample_factor, skip_raw_label_comparison=True
23 )
24 train_set, val_set = torch.utils.data.random_split(dataset, [0, 1])

File /opt/conda/envs/yolostutter/lib/python3.10/site-packages/torch/serialization.py:986, in load(f, map_location, pickle_module, weights_only, mmap, **pickle_load_args)
983 if 'encoding' not in pickle_load_args.keys():
984 pickle_load_args['encoding'] = 'utf-8'
--> 986 with _open_file_like(f, 'rb') as opened_file:
987 if _is_zipfile(opened_file):
988 # The zipfile reader is going to advance the current file position.
989 # If we want to actually tail call to torch.jit.load, we need to
990 # reset back to the original position.
991 orig_position = opened_file.tell()

File /opt/conda/envs/yolostutter/lib/python3.10/site-packages/torch/serialization.py:435, in _open_file_like(name_or_buffer, mode)
433 def _open_file_like(name_or_buffer, mode):
434 if _is_path(name_or_buffer):
--> 435 return _open_file(name_or_buffer, mode)
436 else:
437 if 'w' in mode:

File /opt/conda/envs/yolostutter/lib/python3.10/site-packages/torch/serialization.py:416, in _open_file.init(self, name, mode)
415 def init(self, name, mode):
--> 416 super().init(open(name, mode))

IsADirectoryError: [Errno 21] Is a directory: '../saved_models/conv1d_transformer_decoder_tts_joint'

@rorizzz
Copy link
Owner

rorizzz commented Oct 23, 2024

hey, I feel the issue is not about the checkpoint, but the path you put into the torch.load should be decoder = torch.load("../saved_models/decoder_tts_new_l", map_location=device).

Besides, pretrained VITS weights are not applicable here, since they are used for obtaining the soft_alignment, but here we are uploading the weights for decoder.

@GO0108
Copy link
Author

GO0108 commented Oct 29, 2024

Got it, but I still have the same issue with this path. Is this error related to a specific torch version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants