"Lesson5_sgd_mnist" cannot download file http://deeplearning.net/data/mnist/mnist.pkl.gz

I have got so many troubles with Lesson5_sgd_mnist, already spent too many hours and I hope someone can help. I could not download the file on the server deeplearning.net so I downloaded from a different server (on Kaggle) and it looked like it worked at first. The format was different so I had to do some reshape, and then change to type=float… My problem now is that I get this message:

According to the error message, it looks that the format of the argument “target” should be a scalar of type Long, not float. I cant see how to fix this, how to change “target” type to Long, where to find this argument in the code, etc…

Thanks in advance,

sorry if this is trivial, i just hope someone had same trouble and found a solution.

I found a solution! I am happy to share in case anyone falls into the same problem. my original problem was that I could not find the file http://deeplearning.net/data/mnist/mnist.pkl.gz, no response from the server. So I downloaded another mnist.pkl.gz from another site but it appear it was not in the same exact format…so it did not work for me.

On the other hand, I found that there is an uncompressed file /home/jupyter/.fastai/data/mnist.pkl in the notebook that I could use directly. Since it is already uncompressed, and in a different folder than expected in the lesson notebook, I made the following modifications:

Then it all worked!

It was quite a trivial problem for an experienced user, I am still a novice so it took me a few hours to find the solution,

1 Like