在Unibo PowerTools数据集上没有此类文件或目录错误
我在COLAB中运行该程序,并且在加速数据时会在base_path中遇到错误
导入numpy作为NP 导入大熊猫作为pd 导入scipy.io 导入数学 导入操作系统 导入ntpath 导入系统 导入记录 进口时间 导入系统,
from importlib import reload
import plotly.graph_objects as go
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
from keras.models import Sequential
from keras.layers.core import Dense, Dropout, Activation
from keras.optimizers import gradient_descent_v2
from keras.utils import np_utils
from keras.layers import LSTM, Embedding, RepeatVector, TimeDistributed, Masking
from keras.callbacks import EarlyStopping, ModelCheckpoint, LambdaCallback
IS_COLAB = True
if IS_COLAB:
from google.colab import drive
drive.mount('/content/drive')
data_path = "/content/drive/My Drive/battery-state-estimation/battery-state-estimation/"
else:
data_path = "../"
sys.path.append(data_path)
from data_processing.unibo_powertools_data import UniboPowertoolsData, CycleCols
from data_processing.model_data_handler import ModelDataHandler
dataset = UniboPowertoolsData(
test_types=['S'],
chunk_size=1000000,
lines=[37, 40],
charge_line=37,
discharge_line=40,
base_path='/content/drive/MyDrive/battery-state-estimation/battery-state-estimation'
)
该代码在Colabs中运行。 base_path不适合运行代码。任何人都可以解决这个问题吗
2022/06/26 16:36:18 [DEBUG]: Start loading data with lines: [37, 40], types: ['S'] and chunksize: 1000000...
---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
<ipython-input-13-b98ba86c5d3b> in <module>()
5 charge_line=37,
6 discharge_line=40,
----> 7 base_path='/content/drive/MyDrive/battery-state-estimation/battery-state-estimation'
8 )
10 frames
/usr/local/lib/python3.7/dist-packages/pandas/io/common.py in get_handle(path_or_buf, mode, encoding, compression, memory_map, is_text, errors, storage_options)
705 encoding=ioargs.encoding,
706 errors=errors,
--> 707 newline="",
708 )
709 else:
FileNotFoundError: [Errno 2] No such file or directory: '/content/drive/MyDrive/battery-state-estimation/battery-state-estimationdata/unibo-powertools-dataset/unibo-/test_result.csv'
I run the program in colab and it getting error in base_path in accesing data
import numpy as np
import pandas as pd
import scipy.io
import math
import os
import ntpath
import sys
import logging
import time
import sys
from importlib import reload
import plotly.graph_objects as go
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
from keras.models import Sequential
from keras.layers.core import Dense, Dropout, Activation
from keras.optimizers import gradient_descent_v2
from keras.utils import np_utils
from keras.layers import LSTM, Embedding, RepeatVector, TimeDistributed, Masking
from keras.callbacks import EarlyStopping, ModelCheckpoint, LambdaCallback
IS_COLAB = True
if IS_COLAB:
from google.colab import drive
drive.mount('/content/drive')
data_path = "/content/drive/My Drive/battery-state-estimation/battery-state-estimation/"
else:
data_path = "../"
sys.path.append(data_path)
from data_processing.unibo_powertools_data import UniboPowertoolsData, CycleCols
from data_processing.model_data_handler import ModelDataHandler
dataset = UniboPowertoolsData(
test_types=['S'],
chunk_size=1000000,
lines=[37, 40],
charge_line=37,
discharge_line=40,
base_path='/content/drive/MyDrive/battery-state-estimation/battery-state-estimation'
)
This the code run in colabs.
base_path is not suitable to run the code. can anyone fix the problem
2022/06/26 16:36:18 [DEBUG]: Start loading data with lines: [37, 40], types: ['S'] and chunksize: 1000000...
---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
<ipython-input-13-b98ba86c5d3b> in <module>()
5 charge_line=37,
6 discharge_line=40,
----> 7 base_path='/content/drive/MyDrive/battery-state-estimation/battery-state-estimation'
8 )
10 frames
/usr/local/lib/python3.7/dist-packages/pandas/io/common.py in get_handle(path_or_buf, mode, encoding, compression, memory_map, is_text, errors, storage_options)
705 encoding=ioargs.encoding,
706 errors=errors,
--> 707 newline="",
708 )
709 else:
FileNotFoundError: [Errno 2] No such file or directory: '/content/drive/MyDrive/battery-state-estimation/battery-state-estimationdata/unibo-powertools-dataset/unibo-/test_result.csv'
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论