YuboZhangPKU / ERICA

GNU General Public License v3.0
18 stars 0 forks source link

模型使用gpu训练时输出结果过于一致,在多条染色体上验证时都过于一致,与cpu训练结果不同 #9

Open Admpeace opened 5 months ago

Admpeace commented 5 months ago

因为预测时结果有误,打扰您了,特向您请教一下原因 以下是预测时的日志信息 WARNING:tensorflow:From /home/LiY/.conda/envs/ERICAgpu/lib/python3.6/site-packages/tensorflow_core/python/ops/resource_variable_ops.py:1635: calling BaseResourceVariable.init (from tensorflow.python.ops.resource_variable_ops) with constraint is deprecated and will be removed in a future version. Instructions for updating: If using Keras pass *_constraint arguments to layers. WARNING:tensorflow:From ERICAPrediction1.py:299: dense (from tensorflow.python.layers.core) is deprecated and will be removed in a future version. Instructions for updating: Use keras.layers.Dense instead. WARNING:tensorflow:From /home/LiY/.conda/envs/ERICAgpu/lib/python3.6/site-packages/tensorflow_core/python/layers/core.py:187: Layer.apply (from tensorflow.python.keras.engine.base_layer) is deprecated and will be removed in a future version. Instructions for updating: Please use layer.__call__ method instead. 2024-06-27 16:13:25.124291: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcuda.so.1 2024-06-27 16:13:27.222079: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1555] Found device 0 with properties: pciBusID: 0000:3e:00.0 name: NVIDIA GeForce RTX 3090 computeCapability: 8.6 coreClock: 1.695GHz coreCount: 82 deviceMemorySize: 23.70GiB deviceMemoryBandwidth: 871.81GiB/s 2024-06-27 16:13:27.223771: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudart.so.10.1 2024-06-27 16:13:27.256603: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcublas.so.10 2024-06-27 16:13:27.274182: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcufft.so.10 2024-06-27 16:13:27.278406: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcurand.so.10 2024-06-27 16:13:27.312468: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcusolver.so.10 2024-06-27 16:13:27.317007: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcusparse.so.10 2024-06-27 16:13:27.374689: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudnn.so.7 2024-06-27 16:13:27.376206: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1697] Adding visible gpu devices: 0 2024-06-27 16:13:27.377171: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 AVX512F FMA 2024-06-27 16:13:27.416112: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2900000000 Hz 2024-06-27 16:13:27.418671: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x559e51b6ce80 initialized for platform Host (this does not guarantee that XLA will be used). Devices: 2024-06-27 16:13:27.418810: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): Host, Default Version 2024-06-27 16:13:27.526264: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x559e50df9070 initialized for platform CUDA (this does not guarantee that XLA will be used). Devices: 2024-06-27 16:13:27.526408: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): NVIDIA GeForce RTX 3090, Compute Capability 8.6 2024-06-27 16:13:27.528533: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1555] Found device 0 with properties: pciBusID: 0000:3e:00.0 name: NVIDIA GeForce RTX 3090 computeCapability: 8.6 coreClock: 1.695GHz coreCount: 82 deviceMemorySize: 23.70GiB deviceMemoryBandwidth: 871.81GiB/s 2024-06-27 16:13:27.528722: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudart.so.10.1 2024-06-27 16:13:27.528798: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcublas.so.10 2024-06-27 16:13:27.528868: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcufft.so.10 2024-06-27 16:13:27.528973: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcurand.so.10 2024-06-27 16:13:27.529042: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcusolver.so.10 2024-06-27 16:13:27.529111: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcusparse.so.10 2024-06-27 16:13:27.529179: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudnn.so.7 2024-06-27 16:13:27.532752: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1697] Adding visible gpu devices: 0 2024-06-27 16:13:27.533412: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudart.so.10.1 2024-06-27 16:13:27.535199: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1096] Device interconnect StreamExecutor with strength 1 edge matrix: 2024-06-27 16:13:27.535267: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1102] 0 2024-06-27 16:13:27.535322: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1115] 0: N 2024-06-27 16:13:27.537499: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1241] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 22813 MB memory) -> physical GPU (device: 0, name: NVIDIA GeForce RTX 3090, pci bus id: 0000:3e:00.0, compute capability: 8.6) 2024-06-27 16:34:32.219872: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcublas.so.10 2024-06-27 16:50:02.627621: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudnn.so.7 2024-06-27 17:25:31.162258: W tensorflow/stream_executor/gpu/redzone_allocator.cc:312] Not found: ./bin/ptxas not found Relying on driver to perform ptx compilation. This message will be only logged once. /home/LiY/.conda/envs/ERICAgpu/lib/python3.6/site-packages/plotnine/ggplot.py:729: PlotnineWarning: Saving 40 x 15 in image. from_inches(height, units), units), PlotnineWarning) /home/LiY/.conda/envs/ERICAgpu/lib/python3.6/site-packages/plotnine/ggplot.py:730: PlotnineWarning: Filename: /data/LiY/disk/cjr/ERICA/data2/chr7_CM008174.2_10k_MaxValue.pdf warn('Filename: {}'.format(filename), PlotnineWarning) /home/LiY/.conda/envs/ERICAgpu/lib/python3.6/site-packages/plotnine/layer.py:433: PlotnineWarning: position_stack : Removed 1 rows containing missing values. data = self.position.setup_data(self.data, params) /home/LiY/.conda/envs/ERICAgpu/lib/python3.6/site-packages/plotnine/ggplot.py:729: PlotnineWarning: Saving 40 x 15 in image. from_inches(height, units), units), PlotnineWarning) /home/LiY/.conda/envs/ERICAgpu/lib/python3.6/site-packages/plotnine/ggplot.py:730: PlotnineWarning: Filename: /data/LiY/disk/cjr/ERICA/data2/chr7_CM008174.2_10k_Area.pdf warn('Filename: {}'.format(filename), PlotnineWarning) /home/LiY/.conda/envs/ERICAgpu/lib/python3.6/site-packages/plotnine/layer.py:433: PlotnineWarning: position_stack : Removed 1 rows containing missing values. data = self.position.setup_data(self.data, params) /home/LiY/.conda/envs/ERICAgpu/lib/python3.6/site-packages/plotnine/layer.py:433: PlotnineWarning: position_stack : Removed 1 rows containing missing values. data = self.position.setup_data(self.data, params) /home/LiY/.conda/envs/ERICAgpu/lib/python3.6/site-packages/plotnine/layer.py:433: PlotnineWarning: position_stack : Removed 1 rows containing missing values. data = self.position.setup_data(self.data, params) /home/LiY/.conda/envs/ERICAgpu/lib/python3.6/site-packages/plotnine/layer.py:433: PlotnineWarning: position_stack : Removed 1 rows containing missing values. data = self.position.setup_data(self.data, params) /home/LiY/.conda/envs/ERICAgpu/lib/python3.6/site-packages/plotnine/layer.py:433: PlotnineWarning: position_stack : Removed 1 rows containing missing values. data = self.position.setup_data(self.data, params) /home/LiY/.conda/envs/ERICAgpu/lib/python3.6/site-packages/plotnine/layer.py:433: PlotnineWarning: position_stack : Removed 1 rows containing missing values. data = self.position.setup_data(self.data, params) /home/LiY/.conda/envs/ERICAgpu/lib/python3.6/site-packages/plotnine/layer.py:433: PlotnineWarning: position_stack : Removed 1 rows containing missing values. data = self.position.setup_data(self.data, params) /home/LiY/.conda/envs/ERICAgpu/lib/python3.6/site-packages/plotnine/layer.py:433: PlotnineWarning: position_stack : Removed 1 rows containing missing values. data = self.position.setup_data(self.data, params) /home/LiY/.conda/envs/ERICAgpu/lib/python3.6/site-packages/plotnine/layer.py:433: PlotnineWarning: position_stack : Removed 1 rows containing missing values. data = self.position.setup_data(self.data, params) /home/LiY/.conda/envs/ERICAgpu/lib/python3.6/site-packages/plotnine/layer.py:433: PlotnineWarning: position_stack : Removed 1 rows containing missing values. data = self.position.setup_data(self.data, params) /home/LiY/.conda/envs/ERICAgpu/lib/python3.6/site-packages/plotnine/layer.py:433: PlotnineWarning: position_stack : Removed 1 rows containing missing values. data = self.position.setup_data(self.data, params) /home/LiY/.conda/envs/ERICAgpu/lib/python3.6/site-packages/plotnine/layer.py:433: PlotnineWarning: position_stack : Removed 1 rows containing missing values. data = self.position.setup_data(self.data, params) /home/LiY/.conda/envs/ERICAgpu/lib/python3.6/site-packages/plotnine/layer.py:433: PlotnineWarning: position_stack : Removed 1 rows containing missing values. data = self.position.setup_data(self.data, params) /home/LiY/.conda/envs/ERICAgpu/lib/python3.6/site-packages/plotnine/layer.py:433: PlotnineWarning: position_stack : Removed 1 rows containing missing values. data = self.position.setup_data(self.data, params) /home/LiY/.conda/envs/ERICAgpu/lib/python3.6/site-packages/plotnine/layer.py:433: PlotnineWarning: position_stack : Removed 1 rows containing missing values. data = self.position.setup_data(self.data, params) /home/LiY/.conda/envs/ERICAgpu/lib/python3.6/site-packages/plotnine/ggplot.py:729: PlotnineWarning: Saving 40 x 15 in image. from_inches(height, units), units), PlotnineWarning) /home/LiY/.conda/envs/ERICAgpu/lib/python3.6/site-packages/plotnine/ggplot.py:730: PlotnineWarning: Filename: /data/LiY/disk/cjr/ERICA/data2/chr7_CM008174.2_10k_Line.pdf warn('Filename: {}'.format(filename), PlotnineWarning) 以下是输出数据 image image image

请问作者预测使用gpu时所用代码是所给的那个吗

YuboZhangPKU commented 4 months ago

您好,感谢您的使用。利用训练好的模型使用ERICAPrediction.py进行预测时,使用CPU或GPU是不会影响计算结果的。我也再次进行了测试和确认。不知道您使用的是test文件夹中的测试数据集还是其他的数据?可以考虑使用GPU对测试数据集进行预测,并和test_result中的结果文件进行比较,以确认是否正确加载了模型。