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

make training work on my Win10 #2

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
.ipynb_checkpoints/
.idea/
*.pyc
web_app/static/data/
web_app/static/data/

DSBI
NN_results
data
env
weights/*.t7
weights/*zuev.txt
10 changes: 5 additions & 5 deletions model/params.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
settings = AttrDict(
max_epochs=100000,
tensorboard_port=6006,
device='cuda:3',
device='cuda:0',
findLR=False,
can_overwrite=False,
)
Expand All @@ -15,17 +15,17 @@
data = AttrDict(
get_points = False,
class_as_6pt=False, # классификация присутствия каждой точки в рамке отдельно
batch_size = 12,
batch_size = 6, # with batch size 12 my GPU runs out of memory
net_hw = (416, 416),
rect_margin = 0.3, # every of 4 margions to char width
max_std = 0.1,
train_list_file_names = [
#r'DSBI/data/val_li2.txt',
r'DSBI/data/train_li2.txt',
r'DSBI/data/train.txt',
],
val_list_file_names = {
'val' : [r'DSBI/data/val_li2.txt',],
'test' : [r'DSBI/data/test_li2.txt',]
'val' : [r'DSBI/data/test.txt',],
'test' : [r'DSBI/data/test.txt',]
}
),
augmentation = AttrDict(
Expand Down
6 changes: 6 additions & 0 deletions model/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
torch==1.5.0
torchvision==0.6.0 # pip install torch===1.5.0 torchvision===0.6.0 -f https://download.pytorch.org/whl/torch_stable.html

pytorch-ignite
tensorboardX
Levenshtein
3 changes: 1 addition & 2 deletions model/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
from pathlib import Path

import ovotools.ignite_tools
import ovotools.pytorch_tools
import ovotools.pytorch

from data_utils import data
Expand All @@ -25,7 +24,7 @@

if settings.findLR:
params.model_name += '_findLR'
params.save(can_overwrite=settings.can_overwrite)
params.save(can_overwrite=settings.can_overwrite, create_dirs=True)


ctx = ovotools.pytorch.Context(settings=None, params=params)
Expand Down
4 changes: 2 additions & 2 deletions run_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import local_config
import model.infer_retinanet as infer_retinanet

model_weights = 'model.t7'
model_weights = 'model-zuev.t7'

parser = argparse.ArgumentParser(description='Angelina Braille Reader: optical Braille text recognizer .')

Expand All @@ -27,7 +27,7 @@
exit()

recognizer = infer_retinanet.BrailleInference(
params_fn=os.path.join(local_config.data_path, 'weights', 'param.txt'),
params_fn=os.path.join(local_config.data_path, 'weights', 'param-zuev.txt'),
model_weights_fn=os.path.join(local_config.data_path, 'weights', model_weights),
create_script=None)

Expand Down