petrpan26 / aivivn_1 Goto Github PK
View Code? Open in Web Editor NEWOur submission for Aivivn Contest 1.
Our submission for Aivivn Contest 1.
Traceback (most recent call last):
File "/content/drive/My Drive/Aivivn_1/main_hierarchical.py", line 247, in
args.fix_embed, args.add_embed, args.aug, args.aug_min_len, args.print_model, args.model
File "/content/drive/My Drive/Aivivn_1/main_hierarchical.py", line 117, in train_model
use_additive_emb = use_additive_emb
File "/content/drive/My Drive/Aivivn_1/scripts/rnn.py", line 198, in HRNN
word_lstm = Bidirectional(CuDNNLSTM(128))(embed)
File "/usr/local/lib/python3.6/dist-packages/keras/layers/wrappers.py", line 428, in call
return super(Bidirectional, self).call(inputs, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/keras/engine/base_layer.py", line 408, in call
self.assert_input_compatibility(inputs)
File "/usr/local/lib/python3.6/dist-packages/keras/engine/base_layer.py", line 305, in assert_input_compatibility
str(K.ndim(x)))
ValueError: Input 0 is incompatible with layer bidirectional_1: expected ndim=3, found ndim=4
Reference:
Anh có thể cho em biết làm thế nào để upgrade từ CuDNN 7.3.1 lên 7.6.2 trên Google Colab được ko ạ. Em chạy thử thấy code compile bằng CuDNN 7.6.2, nếu ko cài lại thì không chạy được nhiều mô hình trong hai file main và main_stack ạ.
Khi em chạy thử model này thì bị dính lỗi này anh ạ, anh có biết giải quyết như thế nào ko ạ?
Traceback (most recent call last):
File "/content/drive/My Drive/Colab Notebooks/Aivivn_1/main_stack_hier.py", line 191, in
int(args.max), args.mix)
File "/content/drive/My Drive/Colab Notebooks/Aivivn_1/main_stack_hier.py", line 104, in stack
for model in models_list
File "/content/drive/My Drive/Colab Notebooks/Aivivn_1/main_stack_hier.py", line 104, in
for model in models_list
File "/content/drive/My Drive/Colab Notebooks/Aivivn_1/scripts/rnn.py", line 144, in SARNNKeras
)(x)
File "/usr/local/lib/python3.6/dist-packages/keras/engine/base_layer.py", line 451, in call
output = self.call(inputs, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/keras_self_attention/seq_self_attention.py", line 169, in call
e = self._call_additive_emission(inputs)
File "/usr/local/lib/python3.6/dist-packages/keras_self_attention/seq_self_attention.py", line 223, in _call_additive_emission
q = K.tile(K.expand_dims(q, 2), K.stack([1, 1, input_len, 1]))
File "/usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py", line 2430, in tile
if len(n) < len(shape): # Padding the axis
TypeError: object of type 'Tensor' has no len()
I got this error: OSError: Unable to create file (unable to open file: name = './models/2019-05-28-08:51:38-version/models.hdf5', errno = 22, error message = 'Invalid argument', flags = 13, o_flags = 302)
when calling:
python -m main -m VDCNN -e ./embeddings/smallFasttext.vi.vec --max 40000 --mix --prob
Here is the full log:
Using TensorFlow backend.
Number of train data: (16087, 1)
Here1
Folder already created
Folder already created
HERE2
2019-05-28 10:11:19.429735: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
WARNING: Logging before flag parsing goes to stderr.
W0528 10:11:19.639334 5676 deprecation.py:506] From C:\Users\Alice\Anaconda3\lib\site-packages\tensorflow\python\training\moving_averages.py:210: calling Zeros.__init__ (from tensorflow.python.op
s.init_ops) with dtype is deprecated and will be removed in a future version.
Instructions for updating:
Call initializer instance with the dtype argument instead of passing it to the constructor
HERE3
HERE4
W0528 10:11:21.114854 5676 deprecation.py:323] From C:\Users\Alice\Anaconda3\lib\site-packages\tensorflow\python\ops\array_grad.py:425: to_int32 (from tensorflow.python.ops.math_ops) is deprecate
d and will be removed in a future version.
Instructions for updating:
Use tf.cast instead.
Train on 15282 samples, validate on 805 samples
Epoch 1/100
15282/15282 [==============================] - 160s 11ms/step - loss: 0.6130 - acc: 0.6693 - f1: 0.5369 - val_loss: 0.8933 - val_acc: 0.6087 - val_f1: 0.1392
Epoch 00001: val_f1 improved from -inf to 0.13925, saving model to ./models/2019-05-28-10:10:58-version/models.hdf5
Traceback (most recent call last):
File "C:\Users\Alice\Anaconda3\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "C:\Users\Alice\Anaconda3\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "F:\SOCIAL_MONITORING\AIVIVN\Aivivn_1\main.py", line 234, in <module>
args.use_sim_dict, args.print_model, args.model)
File "F:\SOCIAL_MONITORING\AIVIVN\Aivivn_1\main.py", line 123, in train_model
batch_size=batch_size
File "C:\Users\Alice\Anaconda3\lib\site-packages\keras\engine\training.py", line 1705, in fit
validation_steps=validation_steps)
File "C:\Users\Alice\Anaconda3\lib\site-packages\keras\engine\training.py", line 1255, in _fit_loop
callbacks.on_epoch_end(epoch, epoch_logs)
File "C:\Users\Alice\Anaconda3\lib\site-packages\keras\callbacks.py", line 77, in on_epoch_end
callback.on_epoch_end(epoch, logs)
File "C:\Users\Alice\Anaconda3\lib\site-packages\keras\callbacks.py", line 447, in on_epoch_end
self.model.save(filepath, overwrite=True)
File "C:\Users\Alice\Anaconda3\lib\site-packages\keras\engine\topology.py", line 2580, in save
save_model(self, filepath, overwrite, include_optimizer)
File "C:\Users\Alice\Anaconda3\lib\site-packages\keras\models.py", line 106, in save_model
with h5py.File(filepath, mode='w') as f:
File "C:\Users\Alice\Anaconda3\lib\site-packages\h5py\_hl\files.py", line 312, in __init__
fid = make_fid(name, mode, userblock_size, fapl, swmr=swmr)
File "C:\Users\Alice\Anaconda3\lib\site-packages\h5py\_hl\files.py", line 148, in make_fid
fid = h5f.create(name, h5f.ACC_TRUNC, fapl=fapl, fcpl=fcpl)
File "h5py\_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
File "h5py\_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
File "h5py\h5f.pyx", line 98, in h5py.h5f.create
OSError: Unable to create file (unable to open file: name = './models/2019-05-28-10:10:58-version/models.hdf5', errno = 22, error message = 'Invalid argument', flags = 13, o_flags = 302)
I did dig into the log and I think that the file wasnot saved successfully before being read. The problem with keras saving model I think
Anh ơi anh có thể chia sẻ file ./embeddings/annoy.pkl' được không ạ.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.