Code Monkey home page Code Monkey logo

Comments (13)

zzq2747 avatar zzq2747 commented on September 23, 2024 1

I see. Thank you very much for taking your time to reply to me

from trainableactivation.

zzq2747 avatar zzq2747 commented on September 23, 2024 1

Dear author,
There is still something wrong with your code, this time I run train.py and there are still errors. This time it traveled a long distance. But eventually the operation stopped.
Error message:
Traceback (most recent call last):
File "C:\Users\27479\Desktop\TrainableActivation-main\train.py", line 171, in
train()
File "C:\Users\27479\Desktop\TrainableActivation-main\train.py", line 135, in train
torch.save(state_dict, save_path + save_name)
File "C:\Users\27479\anaconda3\envs\TrainableActivation-main\lib\site-packages\torch\serialization.py", line 618, in save
with _open_zipfile_writer(f) as opened_zipfile:
File "C:\Users\27479\anaconda3\envs\TrainableActivation-main\lib\site-packages\torch\serialization.py", line 492, in _open_zipfile_writer
return container(name_or_buffer)
File "C:\Users\27479\anaconda3\envs\TrainableActivation-main\lib\site-packages\torch\serialization.py", line 463, in init
super().init(torch._C.PyTorchFileWriter(self.name))
RuntimeError: Parent directory ./checkpoints/coslu/cifar10/resnet8 does not exist.

from trainableactivation.

zzq2747 avatar zzq2747 commented on September 23, 2024 1

Dear author, I have successfully run your code by manually creating checkpoints folders in your source code myself. I have also seen the results in the logs folder, but I see that there are images in your paper, and I wonder if there is any code in your source code to draw the images? If so, where is it? And how to achieve it

from trainableactivation.

epishchik avatar epishchik commented on September 23, 2024

It looks like you didn't specify the --config argument when you tried to run train.py, the default path to config is ./configs.yaml, this file doesn't exist in the directory, you should select the config you want to use from the configs folder and pass it as the --config argument.

Let's say I want to train and test the ResNet-8 model with CosLU trainable activation on the CIFAR-10 dataset.

python train.py --config configs/coslu/cifar10/resnet8.yaml
python test.py --config configs/coslu/cifar10/resnet8.yaml

Please check the scripts folder, there are many pre-configured options you can run.

from trainableactivation.

zzq2747 avatar zzq2747 commented on September 23, 2024

Shi you file configs/coslu/cifar10 / resnet8 yaml [' train '] [' save_path] is ". The content of the checkpoints/coslu/cifar10 / ". But you don't have checkpoints in your file. It shows error when I run "train" py is FileNotFoundError: [3] WinError system can not find the specified path: '/ checkpoints/coslu cifar10 / resnet8 /'

from trainableactivation.

zzq2747 avatar zzq2747 commented on September 23, 2024

The error message is
File "C:\Users\27479\Desktop\TrainableActivation-main\train.py", line 171, in
train()
File "C:\Users\27479\Desktop\TrainableActivation-main\train.py", line 58, in train
os.mkdir(save_path)
FileNotFoundError: [WinError 3] The system cannot find the specified path. : './checkpoints/coslu/cifar10/resnet8/'

from trainableactivation.

epishchik avatar epishchik commented on September 23, 2024

Yeap, I've found it, it's because the code tries to create a folder but there is no parent folder in the folder chain, I'll fix it soon.

from trainableactivation.

epishchik avatar epishchik commented on September 23, 2024

Another important thing to note is that I've trained and tested all configurations on the GPU, so you may need to change the device from cuda:0 / cuda:1 to cpu if you don't have one.

from trainableactivation.

epishchik avatar epishchik commented on September 23, 2024

Fixed issue with checkpoints folder.

from trainableactivation.

epishchik avatar epishchik commented on September 23, 2024

This seems strange, can you check if the script has created the ./checkpoints/coslu/cifar10/resnet8 folder in the root of the project? The error says there is no such folder.

It's better to set the 'train.save_every' parameter to 1 in the config yaml file to test if the checkpoint saving works correctly, because now you have to wait for 10 epochs.

P.S. It works fine on my local machine, check that you haven't accidentally deleted the checkpoints folder, if it doesn't work please provide the training log file and your system configuration.

from trainableactivation.

zzq2747 avatar zzq2747 commented on September 23, 2024

Dear Author,
After I run "train" py display error, I didn't find the file in my root directory '. / checkpoints/coslu/cifar10 / resnet8 ". My system is windows10, and the interpreter is a Python10-based virtual environment created by anaconda3.
The file I downloaded was a zip package downloaded from your code page on GitHub. There should be no missing files. I feel like I'm running train. Py he won't generate its own ". / checkpoints/coslu cifar10 / resnet8 "file. Whether we need to manually create the file '. / checkpoints/coslu/cifar10 / resnet8 "?

from trainableactivation.

epishchik avatar epishchik commented on September 23, 2024

I fixed this yesterday, this folder is created automatically (you shouldn't create it manually) and after N epochs the script will save the checkpoint in this folder, ./ means it will create a folder chain in the folder you are in, so check this.

Also by default a new checkpoint file is created every 10 epochs.

I haven't tested it on Windows (but I don't think it's a platform issue), I'm using Ubuntu 22.04 LTS, maybe you can try running the code in the Windows subsystem for Linux.

from trainableactivation.

epishchik avatar epishchik commented on September 23, 2024

I've fixed the problem with automatic folder creation, it should work on Windows now.

To plot graphics you should use plot.py and provide config as argument.

python plot.py --config configs/plot/cifar10/coslu.yaml

You can create your own config to choose only models which you've trained.

Example 1.

models: [ResNet8, ResNet26]
datasets: [CIFAR10]
activations: [CosLU]
log_path: ./logs/
plot_path: ./plot/coslu/
dpi: 70
clip: [0.0, 3.0]

Example 2.

models: [DNN2, DNN3, DNN5]
datasets: [MNIST]
activations:
  [
    Default,
    LinComb,
    ReLUN,
    ScaledSoftSign,
    ShiLU,
    HELU,
    DELU,
    SinLU,
    CosLU,
    NormLinComb,
  ]
log_path: ./logs/
plot_path: ./plot/full/
dpi: 70
clip: [0.0, 3.0]

Or you can run scripts/plot.sh, it will plot some empty plots, but you can find a plot for the model you trained, and it won't be empty.

from trainableactivation.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.