Sampling / training failure
See original GitHub issueHi there. I have an issue with the sampling and training.
Sampling steps with pretrained:
- Downloaded .zip archive from https://github.com/raywenderlich/swift-algorithm-club
- put it into .mltype/languages
- run
mlt sample swift.zip - Get this
Traceback (most recent call last):
File "/usr/local/bin/mlt", line 8, in <module>
sys.exit(cli())
File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1128, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1053, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1659, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1395, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.9/site-packages/click/core.py", line 754, in invoke
return __callback(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/mltype/cli.py", line 575, in sample
network, vocabulary = load_model(model_folder)
File "/usr/local/lib/python3.9/site-packages/mltype/ml.py", line 839, in load_model
output_dict = torch.load(path, map_location=torch.device("cpu"))
File "/usr/local/lib/python3.9/site-packages/torch/serialization.py", line 705, in load
with _open_zipfile_reader(opened_file) as opened_zipfile:
File "/usr/local/lib/python3.9/site-packages/torch/serialization.py", line 243, in __init__
super(_open_zipfile_reader, self).__init__(torch._C.PyTorchFileReader(name_or_buffer))
RuntimeError: Expected hasRecord("version") to be true, but got false. (Could this error message be improved? If so, please report an enhancement request to PyTorch.)
Training steps:
0. having some random *.txt file
- run
mlt train sometext.txt my_model - get this
============================ Parameters | 10:17:48 =============================
{'batch_size': 64,
'checkpoint_path': None,
'dense_size': 128,
'early_stopping': False,
'extensions': None,
'fill_strategy': 'skip',
'gpus': None,
'hidden_size': 32,
'illegal_chars': None,
'max_epochs': 10,
'model_name': 'my_model',
'n_layers': 1,
'output_path': None,
'path': ('sometext.txt',),
'train_test_split': 0.9,
'use_mlflow': False,
'vocab_size': 50,
'window_size': 50}
========================== Reading file(s) | 10:17:48 ==========================
BinarySearch.txt
======================= Computing vocabulary | 10:17:48 ========================
# characters: 50
[' ', '(', ')', '*', '+', ',', '-', '.', '/', '0', '1', '2', ':', '<', '=', '>', '?', 'B', 'C', 'I', 'N', 'S', 'T', '[', ']', '_', 'a', 'b', 'c', 'd', 'e', 'f', 'h', 'i', 'k', 'l', 'm', 'n', 'o', 'p', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', '{', '}']
======================= Creating training set | 10:17:48 =======================
100%|████████████████████████████████████████████| 1/1 [00:00<00:00, 167.42it/s]
X.dtype=int8, y.dtype=int8
Train: 424
Validation: 48
Traceback (most recent call last):
File "/usr/local/bin/mlt", line 8, in <module>
sys.exit(cli())
File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1128, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1053, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1659, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1395, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.9/site-packages/click/core.py", line 754, in invoke
return __callback(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/mltype/cli.py", line 326, in train
run_train(
File "/usr/local/lib/python3.9/site-packages/mltype/ml.py", line 762, in run_train
chp_callback = pl.callbacks.ModelCheckpoint(
TypeError: __init__() got an unexpected keyword argument 'filepath'
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:9 (5 by maintainers)
Top Results From Across the Web
[2210.00279] Failure-informed adaptive sampling for PINNs
The key idea is to define an effective failure probability based on the residual, and then, with the aim of placing more samples...
Read more >Why Haven't Sampling Systems Improved - Swagelok
Why Haven't Sampling Systems Improved — Three Main Reasons · 1. Lack of Sampling System Training and Learning Opportunities · 2. Failure to...
Read more >Sampling Errors in Statistics: Definition, Types, and Calculation
A sampling error is a statistical error that occurs when an analyst does not select a sample that represents the entire population of...
Read more >An efficient sampling method for probability of failure calculation
A sampling method is developed for failure probability calculations which requires that the following assumptions are fullfilled:.
Read more >Sampling Errors - Overview, Example, and Categories
Selection Error – Occurs when the respondents' survey participation is self-selected, implying only those who are interested respond. Selection ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@jankrepl this does not seem to fix the issue
still getting the same error when run
mlt sample swift.zippip freezeshowspytorch-lightning==0.10.0now@bohdan-huma I created a PR #101 where I try to investigate and fix the issue (still work in progress).
The CI is actually failing. It wasn’t run for more than a year so it is a good thing you noticed something is not right:) Thank you again for reporting the issue.
Anyway, the problem is most likely coming from
pytorch-lightningand its major release 1. Run the following for a quick fix that made the CI pass on my machine.