-
Notifications
You must be signed in to change notification settings - Fork 171
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
Issue with executing conv_net_train.py #32
Comments
Hmm... That's strange. Are you using my version or the original version? |
Thanks a lot for your response. Actually because of this issue, I setup your version by installing all the respective modules. When I run the conv_net_train_keras.py in pycharm, I got the following error. I have set up the CUDA on my GPU as well for executing this. 2020-03-30 05:09:51.532398: I tensorflow/core/common_runtime/bfc_allocator.cc:958] 2 Chunks of size 512 totalling 1.0KiB Was it because I'm out of memory in the GPU? If so, please guide me to fix this. Thanks. |
Your welcome :). You can make us happy with giving our project a star :D
Try reducing the batch_size, try with 1 and if it worked, increase it. |
It worked :) Thanks a lot for helping. Traceback (most recent call last): Was it because of the Keras version? I'm using the latest Keras version on Tensorflow 2.1.0. |
Hmm, I think it may be because of the value of (epoch,curr_loss,curr_acc). Are you passing an appropriate dataset containing instances for both classes (0.1 of your training data is your validation dataset) ? |
It worked :) I changed the followings to As the next step, how should I test this model? As an example, when a sample sentence has been given as input, how this model work using the trained model? Please explain me the way of converting this model to real time context. Thank you very much. |
Actually, it needs some effort. First, you should save the final model instead of testing it on the test data. |
Could you please elaborate more on this? Thanks a lot. |
The problem is that this code is designed for testing on the Essays dataset. If you want to feed another data, you have two options:
In both of these directions, you need to extract mairesse psycholinguistics features. full instruction is available here. Then you need to feed your data into the model. First, you should save the trained model (I mentioned where you should do that). Second, since the code is designed for 10 fold cross-validation, change it in order to handle your test samples and preprocess it without dividing it into 10 folds. Third, you need to feed the preprocessed data (embeddings and extracted mairesse features) into the saved model to evaluate and predict the label. |
Thanks for using my forked repository. Are you using Python 2.7 ? Please use these requirements. |
@amirmohammadkz I have one more question can you refer me to any resources to understand the code implementation more (courses or videos) Thanks in advance and sorry to bother you. |
Actually I do not remember the exact time required for each step of the code. In the default setting, it requires 50 epochs to complete, and you need to wait for it. You can configure the code as I mentioned in the readme to reduce the training time. Besides, using a GPU will reduce the training time significantly. If you need to understand the implementation, the only thing I can refer to is the Theano website and the paper. |
batch size: #32 (comment) |
Have you tested this solution? #32 (comment) |
Diffenitely its the batch size. Just reduce it to 1 and then increase until
you get the optimal value.
…On Thu, Apr 16, 2020, 6:20 PM MarwanMo7amed ***@***.***> wrote:
but I tried running on mac I got this
the first epoch finished but then this error popped up
Have you tested this solution? #32 (comment)
<#32 (comment)>
I'll try it now and the batch size
Again Thanks a lot for your response and help
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#32 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABFM2PB7MFPTCC62PM7I7SLRM35KDANCNFSM4LUXWZCQ>
.
|
I have already trained the model, but after training what should i do? is this project meant only for training or is there is any code for testing the trained model. conv_net_classes.py:- What is the use of this python file. |
It will automatically test the trained model on the dafult test set. you can change the test set if you want.#32 (comment) |
then what is the use of conv_net_classes.py |
As far as I can remember, it is about the implementation of layers. |
Now its training smoothly isnt it. If not, yes reduce the epochs as well.
…On Sat, Apr 18, 2020, 5:14 PM MarwanMo7amed ***@***.***> wrote:
Diffenitely its the batch size. Just reduce it to 1 and then increase
until you get the optimal value.
… <#m_7197232379832028263_>
I reduced the batch size to 5 and at the end I got this, should I change
the number of epochs also ?
@CyraxSector <https://github.com/CyraxSector> @amirmohammadkz
<https://github.com/amirmohammadkz>
Epoch 44/50
404/403 [==============================] - 133s 330ms/step - loss:
1.4359e-05 - accuracy: 1.0000 - val_loss: 0.3891 - val_accuracy: 0.5536
Epoch 45/50
404/403 [==============================] - 132s 328ms/step - loss:
2.0959e-05 - accuracy: 1.0000 - val_loss: 0.5558 - val_accuracy: 0.5759
Epoch 46/50
40/403 [=>............................] - ETA: 1:52 - loss: 1.5645e-05 -
accuracy: 1.0000Buffered data was truncated after reaching the output size
limit.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#32 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABFM2PETOOQ7A7MPYARE2CLRNGHB5ANCNFSM4LUXWZCQ>
.
|
Those two files should not be empty. Seems still there are some minor
issues. Please try setting the followings.
Epoches - 1
Batch_size - 1
Embedding - 300
Cheers!
…On Sat, Apr 18, 2020, 8:39 PM MarwanMo7amed ***@***.***> wrote:
Now its training smoothly isnt it. If not, yes reduce the epochs as well.
… <#m_1157241055938692158_>
does this message mean the the output is correct ?
*"Buffered data was truncated after reaching the output size limit."*
also "history_main_model_attr_0_w2v.txt" and
"perf_output_main_model_0_w2v.txt" files are empty, the only file have data
is the log file.
@CyraxSector <https://github.com/CyraxSector> and thanks for your response
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#32 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABFM2PG6AA6OO44MVPGLWR3RNG7CNANCNFSM4LUXWZCQ>
.
|
That's because the file is already open. In logging scenario, the code manages the errors and allows you to monitor the logs at any time, but for the result, result files should be closed at the end of the training in order to be available. |
Yes. I meant you need to wait until the code completes its task successfully. after that history file will be closed. |
@amirmohammadkz I've tested the model successfully by following all your steps. As an example, when a sample sentence has been given as input, it will be evaluated. Thanks a lot for all your guidance. I'll make the PR ASAP. |
How you have tested the model. As described in the comments training and testing will be done by one code. |
Happy to hear that! Thanks a lot! |
Hello, This code is significantly faster and can be run on a regular computer/laptop. The accuracies are higher too. |
I am getting this error when I was trying to load 'GoogleNews-vectors-negative300-SLIM.bin'. (Code given below)
Code is
Any help or guidance is highly appreciated. |
@addy1997 Have a look at my forked repo. I think it will be a better starting point. |
Thanks it worked |
I want to know why I didn't get anything after 50 epochs and instead started over again. Thank you very much for your reply epoch: 47, training time: 9885.98 secs, train perf: 70.90 %, val perf: 55.60 % |
I found four cPickle files after terminating the training, but I don't know how to use them for text prediction |
When I run the conv_net_train.py, the process is holding and the Terminal output is as follows.
('loading data...',)
data loaded!
model architecture: CNN-static
using: word2vec vectors
[('image shape', 153, 300), ('filter shape', [(200, 1, 1, 300), (200, 1, 2, 300), (200, 1, 3, 300)]), ('hidden_units', [200, 200, 2]), ('dropout', [0.5, 0.5, 0.5]), ('batch_size', 50), ('non_static', False), ('learn_decay', 0.95), ('conv_non_linear', 'relu'), ('non
_static', False), ('sqr_norm_lim', 9), ('shuffle_batch', True)]
... training
Your ideas are highly appreciated. @amirmohammadkz
Thanks.
The text was updated successfully, but these errors were encountered: