he-zh / vibration_gan Goto Github PK
View Code? Open in Web Editor NEWImplement GANs to generate time-series signals for imbalanced learning problem. The experiments are conducted using CWRU bearing data.
Implement GANs to generate time-series signals for imbalanced learning problem. The experiments are conducted using CWRU bearing data.
D:\anaconda\envs\tensorflow1.14\python.exe D:/daima/gan/vibration_gan-master/vibration_gan-master/fault_diagnosis.py
Using TensorFlow backend.
D:\anaconda\envs\tensorflow1.14\lib\site-packages\tensorflow\python\framework\dtypes.py:516: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint8 = np.dtype([("qint8", np.int8, 1)])
D:\anaconda\envs\tensorflow1.14\lib\site-packages\tensorflow\python\framework\dtypes.py:517: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint8 = np.dtype([("quint8", np.uint8, 1)])
D:\anaconda\envs\tensorflow1.14\lib\site-packages\tensorflow\python\framework\dtypes.py:518: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint16 = np.dtype([("qint16", np.int16, 1)])
D:\anaconda\envs\tensorflow1.14\lib\site-packages\tensorflow\python\framework\dtypes.py:519: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint16 = np.dtype([("quint16", np.uint16, 1)])
D:\anaconda\envs\tensorflow1.14\lib\site-packages\tensorflow\python\framework\dtypes.py:520: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint32 = np.dtype([("qint32", np.int32, 1)])
D:\anaconda\envs\tensorflow1.14\lib\site-packages\tensorflow\python\framework\dtypes.py:525: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
np_resource = np.dtype([("resource", np.ubyte, 1)])
D:\anaconda\envs\tensorflow1.14\lib\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:541: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint8 = np.dtype([("qint8", np.int8, 1)])
D:\anaconda\envs\tensorflow1.14\lib\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:542: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint8 = np.dtype([("quint8", np.uint8, 1)])
D:\anaconda\envs\tensorflow1.14\lib\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:543: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint16 = np.dtype([("qint16", np.int16, 1)])
D:\anaconda\envs\tensorflow1.14\lib\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:544: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint16 = np.dtype([("quint16", np.uint16, 1)])
D:\anaconda\envs\tensorflow1.14\lib\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:545: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint32 = np.dtype([("qint32", np.int32, 1)])
D:\anaconda\envs\tensorflow1.14\lib\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:550: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
np_resource = np.dtype([("resource", np.ubyte, 1)])
训练样本维度: (5000, 896, 1)
5000 训练样本个数
验证样本的维度 (2500, 896, 1)
2500 验证样本个数
测试样本的维度 (2500, 896, 1)
2500 测试样本个数
WARNING:tensorflow:From D:\anaconda\envs\tensorflow1.14\lib\site-packages\keras\backend\tensorflow_backend.py:66: The name tf.get_default_graph is deprecated. Please use tf.compat.v1.get_default_graph instead.
WARNING:tensorflow:From D:\anaconda\envs\tensorflow1.14\lib\site-packages\keras\backend\tensorflow_backend.py:541: The name tf.placeholder is deprecated. Please use tf.compat.v1.placeholder instead.
WARNING:tensorflow:From D:\anaconda\envs\tensorflow1.14\lib\site-packages\keras\backend\tensorflow_backend.py:4432: The name tf.random_uniform is deprecated. Please use tf.random.uniform instead.
WARNING:tensorflow:From D:\anaconda\envs\tensorflow1.14\lib\site-packages\keras\backend\tensorflow_backend.py:148: The name tf.placeholder_with_default is deprecated. Please use tf.compat.v1.placeholder_with_default instead.
WARNING:tensorflow:From D:\anaconda\envs\tensorflow1.14\lib\site-packages\keras\backend\tensorflow_backend.py:4267: The name tf.nn.max_pool is deprecated. Please use tf.nn.max_pool2d instead.
Traceback (most recent call last):
File "D:/daima/gan/vibration_gan-master/vibration_gan-master/fault_diagnosis.py", line 130, in
model.load_weights('diagnosis_CWRU_model/order-50-0.71-best.hdf5')
File "D:\anaconda\envs\tensorflow1.14\lib\site-packages\keras\engine\saving.py", line 458, in load_wrapper
return load_function(*args, **kwargs)
File "D:\anaconda\envs\tensorflow1.14\lib\site-packages\keras\engine\network.py", line 1208, in load_weights
with h5py.File(filepath, mode='r') as f:
File "D:\anaconda\envs\tensorflow1.14\lib\site-packages\h5py_hl\files.py", line 427, in init
swmr=swmr)
File "D:\anaconda\envs\tensorflow1.14\lib\site-packages\h5py_hl\files.py", line 190, in make_fid
fid = h5f.open(name, flags, fapl=fapl)
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 96, in h5py.h5f.open
OSError: Unable to open file (unable to open file: name = 'diagnosis_CWRU_model/order-50-0.71-best.hdf5', errno = 2, error message = 'No such file or directory', flags = 0, o_flags = 0)
Process finished with exit code 1
1.About the file: samples\ wgan-gp \ORDER\ race-50 \ orderir021-05-17-20_23 \ w-ratio50-order-minmax-or021_98331. out, How is it generated?My run results did not.
2.According to the instructions of "README.md"
$ python train_gan.py --phase='generate' --checkpoint_dir=which-pretrained-model-in-checkpoint-dir --target='B007' --imbalance_ratio=50
About some code changes, how is "--checkpoint_dir=which-pretrained-model-in-checkpoint-dir " changed?
Sorry to bother you again.
When i changed 'train' to ‘generate',and the '--checkpoint_dir=which-pretrained-model-in-checkpoint-dir' becomed 'parser.add_argument('--checkpoint_dir', type=str, default='samples\WGAN-GP\ORDER\ratio-50\orderB007-05-17-20_22\checkpoint\model-97000', help='the saved checkpoint to generate signals')',but i meet the error :UnboundLocalError: local variable 'samples_dir' referenced before assignment.Is it the problem that I modified?
At the same time, I really won't change it'--checkpoint_dir=which-pretrained-model-in-checkpoint-dir'.
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.