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

Occasional trouble downloading model zip file #69

Open
kcbuilder01 opened this issue Apr 2, 2020 · 15 comments
Open

Occasional trouble downloading model zip file #69

kcbuilder01 opened this issue Apr 2, 2020 · 15 comments

Comments

@kcbuilder01
Copy link

Hey, getting an issue when I try to run the upload function in the timbre transfer demo
I run the cell, choose the file to upload then get this error

MessageError Traceback (most recent call last)
in ()
10 # Load audio sample here (.mp3 or .wav3 file)
11 # Just use the first file.
---> 12 filenames, audios = upload()
13 audio = audios[0]
14 audio = audio[np.newaxis, :]

3 frames
/usr/local/lib/python3.6/dist-packages/google/colab/_message.py in read_reply_from_input(message_id, timeout_sec)
104 reply.get('colab_msg_id') == message_id):
105 if 'error' in reply:
--> 106 raise MessageError(reply['error'])
107 return reply.get('data', None)
108

MessageError: RangeError: Maximum call stack size exceeded.

Pls help, thanks!

@jesseengel
Copy link
Contributor

Hmm, never seen that before. Do you have the file that you're trying to upload so we can reproduce?

@kcbuilder01
Copy link
Author

here's the file, just a simple mp3 pluck sound, thanks!
sound transfer test.mp3.zip

@kcbuilder01
Copy link
Author

I just tried to run it inside google chrome and that step works there, but now when I go to the next step to upload my custom checkpoint folder I get this directory error:

`---------------------------------------------------------------------------
UnboundLocalError Traceback (most recent call last)
in ()
35 print("Unzipping... {}".format(fnames))
36 get_ipython().system('unzip -o "/content/$fnames" -d $UPLOAD_DIR &> /dev/null')
---> 37 model_dir = find_model_dir(UPLOAD_DIR)
38 gin_file = os.path.join(model_dir, 'operative_config-0.gin')
39

in find_model_dir(dir_name)
12 model_dir = root
13 break
---> 14 return model_dir
15
16

UnboundLocalError: local variable 'model_dir' referenced before assignment`

@jesseengel
Copy link
Contributor

I just went through the whole process (including training a model) using the sample you uploaded. I was able to successfully upload the audio and a newly trained model and generate audio. I did get your error if the loading dialog was left open too long (it times-out automatically, which is unfortunate), but it worked fine if I just run the cell again and open the load dialog again.

@kcbuilder01
Copy link
Author

thanks for your reply and for trying it out. should i be able to open my checkpoint folder on my desktop? When i try to, I get an error saying the directory or file cannot be found. I think my problem may be stemming from the checkpoint folder not downloading properly onto my machine, then when I reupload it in the timbre transfer demo, it doesnt work.

@kcbuilder01
Copy link
Author

I'm also getting this error: UnboundLocalError: local variable 'model_dir' referenced before assignment when trying to upload my own model/checkpoint folder

@jesseengel
Copy link
Contributor

The notebook has been tested with checkpoints / folders zipped from the other demo notebook train_autoencoder.ipynb. You might want to check out the last cell of that notebook for reference.

@kcbuilder01
Copy link
Author

thanks! I trained the autoencoder again and when I download my checkpoint it says this, does this look normal to you:

updating: ckpt-60000.data-00000-of-00002 (deflated 90%)
updating: ckpt-60000.data-00001-of-00002 (deflated 7%)
updating: ckpt-60000.index (deflated 79%)
updating: operative_config-0.gin (deflated 75%)

Exception happened during processing of request from ('::ffff:127.0.0.1', 47642, 0, 0)
Traceback (most recent call last):
File "/usr/lib/python3.6/socketserver.py", line 320, in _handle_request_noblock
self.process_request(request, client_address)
File "/usr/lib/python3.6/socketserver.py", line 351, in process_request
self.finish_request(request, client_address)
File "/usr/lib/python3.6/socketserver.py", line 364, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/lib/python3.6/socketserver.py", line 724, in init
self.handle()
File "/usr/lib/python3.6/http/server.py", line 418, in handle
self.handle_one_request()
File "/usr/lib/python3.6/http/server.py", line 406, in handle_one_request
method()
File "/usr/lib/python3.6/http/server.py", line 639, in do_GET
self.copyfile(f, self.wfile)
File "/usr/lib/python3.6/http/server.py", line 800, in copyfile
shutil.copyfileobj(source, outputfile)
File "/usr/lib/python3.6/shutil.py", line 82, in copyfileobj
fdst.write(buf)
File "/usr/lib/python3.6/socketserver.py", line 803, in write
self._sock.sendall(b)
ConnectionResetError: [Errno 104] Connection reset by peer

@jesseengel
Copy link
Contributor

Hmm, it looks like the colab notebook is timing out on you. I haven't seen that yet, but there is definitely some variance in the instances pulled up for each colab, so you might actually have some luck trying to download again. Alternatively, if you've been writing everything to your google drive, you should be able to just download the directory from your drive and execute the zip command from the notebook locally.

@kcbuilder01
Copy link
Author

kcbuilder01 commented Apr 8, 2020 via email

@jesseengel
Copy link
Contributor

Nice! Glad it worked.

@ioannist
Copy link

ioannist commented Jun 18, 2020

I am uploading a zip file generated and downloaded from train_autoencoder.ipynb colab notebook that passed the resynthesis tests.

I am getting the same model_dir error in timbre_transfer.ipynb colab notebook when i try to upload the custom model. I tried running the cell a few times, factory reset, and returning root inside find_model_dir (lead to None error). Any ideas?

<ipython-input-3-43885a901aa1> in find_model_dir(dir_name) 12 model_dir = root 13 break ---> 14 return model_dir 15 16 UnboundLocalError: local variable 'model_dir' referenced before assignment

@jesseengel jesseengel reopened this Jun 18, 2020
@jesseengel
Copy link
Contributor

Hi, sorry I'm reopening this because this is a known issue. What's happening is that you're not fully downloading/zipping the model I believe.

I haven't figured out yet why this sometimes fails. You can try also accessing it directly from drive, or downloading manually from the file browser on the left of Colab. Sorry I don't have a fix yet.

@ioannist
Copy link

The first time I downloaded the my_solo_instrument.zip file, it was quite small so I assumed it was broken. The second time I downloaded it, it was 34 MB. However, the file inside G-drive is over 50 MB. I also tried unzipping the downloaded file and it appears it is corrupt. Hope that helps!

@jesseengel
Copy link
Contributor

Yup, that matches my (occasional) experience. Sorry I don't have a better idea of what's going on at the moment, just to say that it seems to be intermittent. Power cycling (restarting browser) seems to work sometimes.

@jesseengel jesseengel changed the title Timbre Transfer Upload Issue Occasional trouble downloading model zip file Mar 27, 2021
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

3 participants