Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

server.py does not return results, but fails with an error. Problem with paths. #476

Open
OniDaito opened this issue Oct 19, 2024 · 0 comments

Comments

@OniDaito
Copy link

Describe the bug
The server.py cannot correctly process the results. With the default settings the server produces errors and no results for any birds.

To Reproduce
Run the server as follows:

python server.py --host 192.168.2.185 --port 9013

Submit a wav file to the server just like the client.py, using the python requests library:

 multipart_form_data = {"audio": (filename, audio_bytes), "meta": (None, json.dumps(mdata))}
response = requests.post(url, files=multipart_form_data)

Watch the response on the server end:

 UP AND RUNNING! LISTENING ON 192.168.2.185:9013
 ####################  2024-10-19 22:11:41.837621  ####################
 {'pmode': 'avg', 'num_results': 5, 'save': False}
 INFO: Created TensorFlow Lite XNNPACK delegate for CPU.
 Analyzing /tmp/tmpy_6rgrl0.wav
 Error: Cannot save result for /tmp/tmpy_6rgrl0.wav.

Take a look at the error_log.txt

Traceback (most recent call last):
File "/home/oni/birdnet/analyze.py", line 545, in analyzeFile
saveResultFiles(results, result_file_names, fpath)
File "/home/oni/birdnet/analyze.py", line 198, in saveResultFiles
os.makedirs(cfg.OUTPUT_PATH, exist_ok=True)
File "<frozen os>", line 225, in makedirs
FileExistsError: [Errno 17] File exists: '/tmp/tmp66xk5gz8.txt'

Expected behavior
No errors and a list of 5 bird species.

Additional context
I'm running the server on an Arch Linux box. I'm recording some wav files and sending them to the server. In the past, the docker version I've used has worked quite well. I'm running this server using python in a virtual environment.

I can see that the server.py is attempting to create a directory with the same name as the temporary wav file. Could this be causing the issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant