Navidfoumani / ConvTran

This is a PyTorch implementation of ConvTran
MIT License
124 stars 8 forks source link

ZeroDivisionError: division by zero #8

Closed ANERIZ closed 4 months ago

ANERIZ commented 4 months ago

When I enter python main.py --epochs 1500 --data_dir Dataset/UEA/, I get the following error: Traceback (most recent call last): File "\D:ConvTran-main\main.py", line 57, in Data_Verifier(config) # Download the UEA and HAR datasets if they are not in the directory File "\D:ConvTran-main\utils.py", line 93, in Data_Verifier Downloader(file_url, 'UEA') File "D:\ConvTran-main\utils.py", line 119, in Downloader progress = (downloaded_size / total_size) * 100 ZeroDivisionError: division by zero

Navidfoumani commented 4 months ago

Please use the following link to download the datasets and extract them into the corresponding folder: https://www.timeseriesclassification.com/aeon-toolkit/Archives/Multivariate2018_ts.zip

ANERIZ commented 4 months ago

14853 I have downloaded the dataset and placed it at the specified path.After running the code, it will change the file content of Multivariate2018_ts.zip to ‘You have tried to access a non-existent file’, and then get the following error message: Traceback (most recent call last): File "D:\ConvTran-main\main.py", line 57, in Data_Verifier(config) # Download the UEA and HAR datasets if they are not in the directory File "D:\ConvTran-main\utils.py", line 93, in Data_Verifier Downloader(file_url, 'UEA') File "D:\ConvTran-main\utils.py", line 128, in Downloader with zipfile.ZipFile(file_path, 'r') as zip_ref: File "C:\Users\James.conda\envs\torch39\lib\zipfile.py", line 1268, in init self._RealGetContents() File "C:\Users\James.conda\envs\torch39\lib\zipfile.py", line 1335, in _RealGetContents raise BadZipFile("File is not a zip file") zipfile.BadZipFile: File is not a zip file

Navidfoumani commented 4 months ago

you should unzip the [Multivariate2018_ts.zip]

ANERIZ commented 4 months ago

After I processed the tasks related to the data set, I got the following error when running according to the instructions: Traceback (most recent call last): File "D:\ConvTran-main\main.py", line 65, in Data = Data_Loader(config) File "D:\ConvTran-main\utils.py", line 78, in Data_Loader Data = load_UEA_data.load(config) # Load UEA *.ts Data File "D:\ConvTran-main\Dataset\load_UEA_data.py", line 40, in load train_df, y_train = load_from_tsfile_to_dataframe(train_file) File "C:\Users\James.conda\envs\torch39\lib\site-packages\sktime\datasets_data_io.py", line 506, in load_from_tsfile_to_dataframe with open(full_file_path_and_name, "r", encoding="utf-8") as file: FileNotFoundError: [Errno 2] No such file or directory: 'Dataset/UEA/Multivariate_ts\ArticularyWordRecognition/Multivariate_ts\ArticularyWordRecognition_TRAIN.ts'

Why is there an extra ' Multivariate_ts 'in the middle directory? My data set is placed in UEA/ after decompression.

Navidfoumani commented 4 months ago

It seems that there might be two sources of the issue. Firstly, the directory path seems to be Unix-based, while it appears that you are using a Windows-based system. Please replace forward slashes ("/") with backslashes ("\"). For example: Dataset\UEA\Multivariate_ts.

Secondly, it appears that the dataset file has been recently updated. The correct address should be: Dataset\UEA\Multivariate_ts\ArticularyWordRecognition\ArticularyWordRecognition_TRAIN.ts."

ANERIZ commented 4 months ago

Thank you for your help. I can now reproduce your code. Then I would like to ask, how to train your own data set? My current data set contains 3,000 patient test data and diagnostic reports. The number of rows of the test data is not uniform. The first column of the three-column csv file is the time, starting from 0 and incrementing every 0.1s. The other two columns are the test content; the diagnostic report is a txt file, which contains the patient’s examination information and Doctor's diagnostic opinion. I would like to ask how should I process my data set to train on your model?