CN-UPB / NFVdeep

NFVdeep: Deep Reinforcement Learning for Online Orchestration of Service Function Chains
MIT License
55 stars 14 forks source link

Error running tune.py #4

Closed Rabipour closed 2 years ago

Rabipour commented 2 years ago

Hi I ran the first part of NFVDeep successfully (Experiments/script.py). But in executing the second part(Hyperparameter Optimization/tune.py) , I encounter the following error:

_File "C:\Users\98913\Documents\Python\NFVdeep-main\tune.py", line 158, in search_alg=AxSearch(ax_client), File "C:\Simulate\lib\site-packages\ray\tune\suggest\ax.py", line 173, in init self._setup_experiment() File "C:\Simulate\lib\site-packages\ray\tune\suggest\ax.py", line 197, in _setupexperiment raise ValueError( ValueError: Please specify the mode argument when initializing the AxSearch object or pass it to tune.run().

I spent many hours fixing it but did not get the result.Please help me fix this error.

stefanbschneider commented 2 years ago

The error message ("or pass it to tune.run()") doesn't really make sense to me since you do pass it to tune.run() in the corresponding line if you didn't change the tune.py script.

Either way, you could try setting mode="max" as extra argument inside the AxSearch constructor. Not sure if this will work. Let me know.

Rabipour commented 2 years ago

The error message ("or pass it to tune.run()") doesn't really make sense to me since you do pass it to tune.run() in the corresponding line if you didn't change the tune.py script.

Either way, you could try setting mode="max" as extra argument inside the AxSearch constructor. Not sure if this will work. Let me know.

I did what you said first (mode="max" inside the AxSearch) ,but it made the same error again. The error was related to requirements and was fixed. Thanks

Rabipour commented 2 years ago

Can the number of nodes be changed for each experiment? If so, where should it be done? Please help me

stefanbschneider commented 2 years ago

Do you mean nodes of the underlying computer network topology? You need to define the network topology in a separate file. There are examples here: https://github.com/CN-UPB/NFVdeep/tree/main/data You can then pass the network file as input when you run the algorithm.

But keep in mind that this is not an official implementation of NFVdeep and that we could not reproduce the results of the paper. Just so you know before you invest too much time.

Rabipour commented 2 years ago

Do you mean nodes of the underlying computer network topology? You need to define the network topology in a separate file. There are examples here: https://github.com/CN-UPB/NFVdeep/tree/main/data You can then pass the network file as input when you run the algorithm.

But keep in mind that this is not an official implementation of NFVdeep and that we could not reproduce the results of the paper. Just so you know before you invest too much time.

Yes, "nodes of the underlying computer network topology" I realized, Thanks

Lundon3344567 commented 7 months ago

ValueError: Please specify the mode argument when initializing the AxSearch object or pass it to tune.TuneConfig(). Try to replace it with the following code

ray.tune.run( evaluate_objective, num_samples=RAY_TUNE_SAMPLES, search_alg=AxSearch(ax_client=ax_client), scheduler=asha_scheduler, verbose=2 )