xifengguo / dec-da Goto Github PK
View Code? Open in Web Editor NEWDeep Embedded Clustering with Data Augmentation (DEC-DA). Performance on MNIST (acc=0.985, nmi=0.960).
License: MIT License
Deep Embedded Clustering with Data Augmentation (DEC-DA). Performance on MNIST (acc=0.985, nmi=0.960).
License: MIT License
During training the model using custom dataset, loss will occur NaN.
I tried decrease the lr but the error still occurs.
The logging info of error is as follows.
Epoch 50/500
400/400 [==============================] - 0s 272us/step - loss: nan
Epoch 51/500
256/400 [==================>...........] -
ETA: 0s - loss: nanTraceback (most recent call last):
File ".\demo.py", line 148, in <module>
train(args)
File ".\demo.py", line 69, in train
save_dir=args.save_dir, verbose=args.verbose, aug_pretrain=args.aug_pretrain)
File "E:\Comparison_Experiments\DEC-DA\FcDEC.py", line 171, in pretrain
self.autoencoder.fit(x, x, batch_size=batch_size, epochs=epochs, callbacks=cb, verbose=verbose)
File "C:\Software\Anaconda3\lib\site-packages\tensorflow\python\keras\engine\training.py", line 1639, in fit
validation_steps=validation_steps)
File "C:\Software\Anaconda3\lib\site-packages\tensorflow\python\keras\engine\training_arrays.py", line 239, in fit_loop
callbacks.on_epoch_end(epoch, epoch_logs)
File "C:\Software\Anaconda3\lib\site-packages\tensorflow\python\keras\callbacks.py", line 214, in on_epoch_end
callback.on_epoch_end(epoch, logs)
File "E:\Comparison_Experiments\DEC-DA\FcDEC.py", line 162, in on_epoch_end
y_pred = km.fit_predict(features)
File "C:\Software\Anaconda3\lib\site-packages\sklearn\cluster\k_means_.py", line 917, in fit_predict
return self.fit(X).labels_
File "C:\Software\Anaconda3\lib\site-packages\sklearn\cluster\k_means_.py", line 887, in fit
X = self._check_fit_data(X)
File "C:\Software\Anaconda3\lib\site-packages\sklearn\cluster\k_means_.py", line 858, in _check_fit_data
X = check_array(X, accept_sparse='csr', dtype=[np.float64, np.float32])
File "C:\Software\Anaconda3\lib\site-packages\sklearn\utils\validation.py", line 453, in check_array
_assert_all_finite(array)
File "C:\Software\Anaconda3\lib\site-packages\sklearn\utils\validation.py", line 44, in _assert_all_finite
" or a value too large for %r." % X.dtype)
ValueError: Input contains NaN, infinity or a value too large for dtype('float32').
Epoch 50/500
400/400 [==============================] - 0s 272us/step - loss: nan
Epoch 51/500
256/400 [==================>...........] - ETA: 0s - loss: nanTraceback (most recent call last):
File ".\demo.py", line 148, in <module>
train(args)
File ".\demo.py", line 69, in train
save_dir=args.save_dir, verbose=args.verbose, aug_pretrain=args.aug_pretrain)
File "E:\Comparison_Experiments\DEC-DA\FcDEC.py", line 171, in pretrain
self.autoencoder.fit(x, x, batch_size=batch_size, epochs=epochs, callbacks=cb, verbose=verbose)
File "C:\Software\Anaconda3\lib\site-packages\tensorflow\python\keras\engine\training.py", line 1639, in fit
validation_steps=validation_steps)
File "C:\Software\Anaconda3\lib\site-packages\tensorflow\python\keras\engine\training_arrays.py", line 239, in fit_loop
callbacks.on_epoch_end(epoch, epoch_logs)
File "C:\Software\Anaconda3\lib\site-packages\tensorflow\python\keras\callbacks.py", line 214, in on_epoch_end
callback.on_epoch_end(epoch, logs)
File "E:\Comparison_Experiments\DEC-DA\FcDEC.py", line 162, in on_epoch_end
y_pred = km.fit_predict(features)
File "C:\Software\Anaconda3\lib\site-packages\sklearn\cluster\k_means_.py", line 917, in fit_predict
return self.fit(X).labels_
File "C:\Software\Anaconda3\lib\site-packages\sklearn\cluster\k_means_.py", line 887, in fit
X = self._check_fit_data(X)
File "C:\Software\Anaconda3\lib\site-packages\sklearn\cluster\k_means_.py", line 858, in _check_fit_data
X = check_array(X, accept_sparse='csr', dtype=[np.float64, np.float32])
File "C:\Software\Anaconda3\lib\site-packages\sklearn\utils\validation.py", line 453, in check_array
_assert_all_finite(array)
File "C:\Software\Anaconda3\lib\site-packages\sklearn\utils\validation.py", line 44, in _assert_all_finite
" or a value too large for %r." % X.dtype)
ValueError: Input contains NaN, infinity or a value too large for dtype('float32').
Can anybody know what's wrong of the setting in this code?
Hello
I tried to train on my own dataset. It is working fine, when I provide the actual (y). When y is None. its loss is nan.
So please fix it or tell me, where I am doing wrong?
Thanks
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.