Can you explain how to run properly with Theano build?
See original GitHub issueHi! I love your blog! I’m trying to try this on my own machine for a class project, but I’m running into some problems running the program correctly. I’m new to python so I don’t know exactly how to run it, but after configuring the correct dependencies, I still ran into some issues trying it for myself. Here are the parameters I used for the Theano combined CNN RNN project:
`# TODO: add argument to choose training set parser.add_argument(‘–network’, type=str, default=“tc_net_mod”, help=‘embeding size (50, 100, 200, 300 only)’) parser.add_argument(‘–epochs’, type=int, default=500, help=‘number of epochs to train’)
parser.add_argument(‘–load_state’, type=str, default=“”, help=‘state file path’)
parser.add_argument(‘–mode’, type=str, default=“train”, help=‘mode: train/test/test_on_train’)
parser.add_argument(‘–batch_size’, type=int, default=32, help=‘no commment’)
parser.add_argument(‘–l2’, type=float, default=0, help=‘L2 regularization’)
parser.add_argument(‘–log_every’, type=int, default=100, help=‘print information every x iteration’)
parser.add_argument(‘–save_every’, type=int, default=50000, help=‘save state every x iteration’)
parser.add_argument(‘–prefix’, type=str, default=“”, help=‘optional prefix of network name’)
parser.add_argument(‘–dropout’, type=float, default=0.0, help=‘dropout rate (between 0 and 1)’)
parser.add_argument(‘–no-batch_norm’, dest=“batch_norm”, action=‘store_false’, help=‘batch normalization’)
parser.add_argument(‘–rnn_num_units’, type=int, default=500, help=‘number of hidden units if the network is RNN’)
parser.add_argument(‘–equal_split’, type=bool, default=False, help=‘use trainEqual.csv and valEqual.csv’)
parser.add_argument(‘–forward_cnt’, type=int, default=1, help=‘if forward pass is nondeterministic, then how many forward passes are averaged’)`
I chose to keep everything mostly default except the first argument where I replace “network_batch” with “tc_net_mod” because I get an error otherwise.
Specifically, I don’t know what the file path should be for this argument:
parser.add_argument('--load_state', type=str, default="", help='state file path')
When I try the .Zip folder with the training data from the Topcoder competition, I get this error:
Traceback (most recent call last): File "C:/Users/Alex/PycharmProjects/Spoken-language-identification/theano/main.py", line 76, in <module> start_epoch = network.load_state(args.load_state) + 1 File "C:\Users\Alex\PycharmProjects\Spoken-language-identification\theano\networks\base_network.py", line 23, in load_state dict = pickle.load(load_file) cPickle.UnpicklingError: A load persistent id instruction was encountered, but no persistent_load function was specified.
I really want to see if I can get this working, It would be great if you could show a how-to guide 😃
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (3 by maintainers)
Hi, sorry for late response,
load_state
argument is designed for loading a state file of some network (not for data). If you want to run the code, you should download dataset from TopCoder, create the spectrograms of recordings, split them into train and validation sets and then change the paths which are used for loading data inmain.py
file.The last softmax layer has 176 neurons. When the cross entropy is calculated, it needs the true labels to be integers from [0, 176). In your mapping from languages to integers you used numbers greater than 175. This is the mapping I used (I didn’t push these files because, as I remember, the training data was not open). I’n not sure the code will work on Windows, I haven’t tested on Windows. On the other hand, as it fails to calculate the cross entropy (which means it has already forwarded an example successfully) probably it will work.