Commit 88a69b79 authored by haowang's avatar haowang

fix

parent d1b63291
from zhihu_captcha import zhihu_captcha
\ No newline at end of file
...@@ -9,38 +9,38 @@ num_classes = 38#3 + 2 + 10 + 1 + 1 ...@@ -9,38 +9,38 @@ num_classes = 38#3 + 2 + 10 + 1 + 1
maxPrintLen = 100 maxPrintLen = 100
tf.app.flags.DEFINE_boolean('restore', True, 'whether to restore from the latest checkpoint') tf.compat.v1.flags.DEFINE_boolean('restore', True, 'whether to restore from the latest checkpoint')
tf.app.flags.DEFINE_string('checkpoint_dir', './checkpoint/', 'the checkpoint dir') tf.compat.v1.flags.DEFINE_string('checkpoint_dir', './checkpoint/', 'the checkpoint dir')
tf.app.flags.DEFINE_float('initial_learning_rate', 1e-3, 'inital lr') tf.compat.v1.flags.DEFINE_float('initial_learning_rate', 1e-3, 'inital lr')
tf.app.flags.DEFINE_integer('image_height', 60, 'image height') tf.compat.v1.flags.DEFINE_integer('image_height', 60, 'image height')
tf.app.flags.DEFINE_integer('image_width', 150, 'image width') tf.compat.v1.flags.DEFINE_integer('image_width', 150, 'image width')
tf.app.flags.DEFINE_integer('image_channel', 1, 'image channels as input') tf.compat.v1.flags.DEFINE_integer('image_channel', 1, 'image channels as input')
tf.app.flags.DEFINE_integer('max_stepsize', 64, 'max stepsize in lstm, as well as ' tf.compat.v1.flags.DEFINE_integer('max_stepsize', 64, 'max stepsize in lstm, as well as '
'the output channels of last layer in CNN') 'the output channels of last layer in CNN')
tf.app.flags.DEFINE_integer('num_hidden', 128, 'number of hidden units in lstm') tf.compat.v1.flags.DEFINE_integer('num_hidden', 128, 'number of hidden units in lstm')
tf.app.flags.DEFINE_integer('num_epochs', 1000, 'maximum epochs') tf.compat.v1.flags.DEFINE_integer('num_epochs', 1000, 'maximum epochs')
tf.app.flags.DEFINE_integer('batch_size', 128, 'the batch_size') tf.compat.v1.flags.DEFINE_integer('batch_size', 128, 'the batch_size')
tf.app.flags.DEFINE_integer('save_steps', 500, 'the step to save checkpoint') tf.compat.v1.flags.DEFINE_integer('save_steps', 500, 'the step to save checkpoint')
tf.app.flags.DEFINE_integer('validation_steps', 500, 'the step to validation') tf.compat.v1.flags.DEFINE_integer('validation_steps', 500, 'the step to validation')
tf.app.flags.DEFINE_float('decay_rate', 0.98, 'the lr decay rate') tf.compat.v1.flags.DEFINE_float('decay_rate', 0.98, 'the lr decay rate')
tf.app.flags.DEFINE_float('beta1', 0.9, 'parameter of adam optimizer beta1') tf.compat.v1.flags.DEFINE_float('beta1', 0.9, 'parameter of adam optimizer beta1')
tf.app.flags.DEFINE_float('beta2', 0.999, 'adam parameter beta2') tf.compat.v1.flags.DEFINE_float('beta2', 0.999, 'adam parameter beta2')
tf.app.flags.DEFINE_integer('decay_steps', 1000, 'the lr decay_step for optimizer') tf.compat.v1.flags.DEFINE_integer('decay_steps', 1000, 'the lr decay_step for optimizer')
tf.app.flags.DEFINE_float('momentum', 0.9, 'the momentum') tf.compat.v1.flags.DEFINE_float('momentum', 0.9, 'the momentum')
tf.app.flags.DEFINE_string('train_dir', './imgs/train/', 'the train data dir') tf.compat.v1.flags.DEFINE_string('train_dir', './imgs/train/', 'the train data dir')
tf.app.flags.DEFINE_string('val_dir', './imgs/val/', 'the val data dir') tf.compat.v1.flags.DEFINE_string('val_dir', './imgs/val/', 'the val data dir')
tf.app.flags.DEFINE_string('infer_dir', './imgs/infer/', 'the infer data dir') tf.compat.v1.flags.DEFINE_string('infer_dir', './imgs/infer/', 'the infer data dir')
tf.app.flags.DEFINE_string('logs_dir', './log', 'the logging dir') tf.compat.v1.flags.DEFINE_string('logs_dir', './log', 'the logging dir')
tf.app.flags.DEFINE_string('mode', 'train', 'train, val or infer') tf.compat.v1.flags.DEFINE_string('mode', 'train', 'train, val or infer')
tf.app.flags.DEFINE_integer('num_gpus', 1, 'num of gpus') tf.compat.v1.flags.DEFINE_integer('num_gpus', 1, 'num of gpus')
FLAGS = tf.app.flags.FLAGS FLAGS = tf.compat.v1.flags.FLAGS
# num_batches_per_epoch = int(num_train_samples/FLAGS.batch_size) # num_batches_per_epoch = int(num_train_samples/FLAGS.batch_size)
......
...@@ -8,9 +8,9 @@ import urllib.parse ...@@ -8,9 +8,9 @@ import urllib.parse
import webbrowser import webbrowser
from io import BytesIO from io import BytesIO
from zhihu_captcha import utils from captcha import utils
from zhihu_captcha import orcmodel from captcha import orcmodel
import tensorflow as tf import tensorflow.compat.v1 as tf
from PIL import Image from PIL import Image
import numpy as np import numpy as np
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment