# Sweep - starting with a small project

**URL:** <https://community.wandb.ai/t/sweep-starting-with-a-small-project/2075>\
**Category:** W&B Help\
**Created:** [March 14, 2022, 4:04pm UTC](https://community.wandb.ai/t/sweep-starting-with-a-small-project/2075 "2022-03-14T16:04:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![xllcrn](https://avatars.discourse-cdn.com/v4/letter/x/4491bb/32.png) [@xllcrn](https://community.wandb.ai/u/xllcrn)\
**Post date:** [March 14, 2022, 4:04pm UTC](https://community.wandb.ai/t/sweep-starting-with-a-small-project/2075/1 "2022-03-14T16:04:43Z")

</div>

Hi there,  
I’m new to W&B and try to use sweep to find best parameters for MNIST with tf2.

First, I ran sweep agent and I’ve got this issue that I don’t understand where it comes from…  
AttributeError: module ‘wandb’ has no attribute ‘init’  
It doesn’t appear when I 'm not using any agent.

Second it’s not clear to me if it’s mandatory to put the hyperparameters as command line arguments. I’m using a json file to fill the default values. I thought I would use this kind of file to configure the sweep.

Where exactly do we have to run the agent? My script train.py is in a folder, source code in another, and my experiment in a third one. I would have like to put the sweep.yaml with my experiments. Is there a way to put the script and the yaml file in a different folder?

Thanks for your help

---

<div class="post-metadata">

**Author:** ![ramit\_goolry](https://avatars.discourse-cdn.com/v4/letter/r/85e7bf/32.png) [@ramit\_goolry](https://community.wandb.ai/u/ramit_goolry)\
**Post date:** [March 14, 2022, 7:25pm UTC](https://community.wandb.ai/t/sweep-starting-with-a-small-project/2075/2 "2022-03-14T19:25:20Z")

</div>

Hi @xllcrn,

I’m sorry you are facing this issue. Can you test where wandb is getting imported from? You should be able to do this by running

```auto
print(wandb. __path__ )

```

Chances are, it is importing the `wandb` directory generated instead of the actual library. Since this is happening with `agent` and not normal runs, one possibility of why this is happening is if you are using `wandb agent` instead of `wandb.agent()` and the interpreter used by `wandb agent` might not have `wandb` installed, causing the generated folder to get imported as a module.

I would recommend trying one of the following solutions:

1. Change the `${interpreter}` in your config.yaml to a Python interpreter which has wandb installed. Check out our docs on Sweep Configuration [here](https://docs.wandb.ai/guides/sweeps/configuration).
2. Alternatively, try using `wandb.agent()` instead of `wandb agent`.

Please let me know if I can assist you any further.

Thanks,  
Ramit

---

<div class="post-metadata">

**Author:** ![ramit\_goolry](https://avatars.discourse-cdn.com/v4/letter/r/85e7bf/32.png) [@ramit\_goolry](https://community.wandb.ai/u/ramit_goolry)\
**Post date:** [March 17, 2022, 9:17pm UTC](https://community.wandb.ai/t/sweep-starting-with-a-small-project/2075/3 "2022-03-17T21:17:05Z")

</div>

Hi @xllcrn ,

We wanted to follow up with you regarding your support request as we have not heard back from you. Please let us know if we can be of further assistance or if your issue has been resolved.

Thanks,  
Weights and Biases Support

---

<div class="post-metadata">

**Author:** ![ramit\_goolry](https://avatars.discourse-cdn.com/v4/letter/r/85e7bf/32.png) [@ramit\_goolry](https://community.wandb.ai/u/ramit_goolry)\
**Post date:** [March 21, 2022, 6:42pm UTC](https://community.wandb.ai/t/sweep-starting-with-a-small-project/2075/4 "2022-03-21T18:42:33Z")

</div>

Hi @xllcrn, since we have not heard back from you we are going to close this request. If you would like to re-open the conversation, please let us know!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/wandb/original/1X/366b649231631dbab896843020da0056074ac79d.png) [@system](https://community.wandb.ai/u/system)\
**Post date:** [May 20, 2022, 6:42pm UTC](https://community.wandb.ai/t/sweep-starting-with-a-small-project/2075/5 "2022-05-20T18:42:47Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
